package.json文件里面dev配置以下,html
"scripts": { "start": "node server.js", "dev": "DEBUG=true node server.js", "clean": "rimraf lib dist coverage", "lint": "eslint src test", "test": "NODE_ENV=test mocha --compilers js:babel-core/register --recursive", "test:watch": "NODE_ENV=test npm test -- --watch", "test:cov": "babel-node $(npm bin)/isparta cover $(npm bin)/_mocha -- --recursive", "check": "npm run lint && npm run test", "build": " ", "preversion": "npm run clean && npm run check", "version": "npm run build", "postversion": "git push && git push --tags && npm run clean", "prepublish": "npm run clean && npm run build" },
若是在window下直接跑命令会有node
debug不是内部命令。这时候要借助cross-env包linux
"dev": "cross-env DEBUG=true node server.js",
就能够了。git
参考:npm
npm ls --global --depth=0
修改全局安装目录地址,参考:json
最后在nodejs的安装目录中找到node_modules\npm\.npmrc文件babel
修改以下便可:post
prefix = D:\nodejs\node_global
cache = D:\nodejs\node_globalui
改完以后,命令行可能没法启动全局包,因此要将对应的目录放到环境变量中去。spa