当我尝试安装npm软件包时,收到错误:
MacBook-Pro-van-Jamie:gulp Egen$ npm install gulp-jshint –save-dev
npm ERR! addLocal Could not install /Users/Egen/Code/gulp/–save-dev
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "gulp-jshint" "–save-dev"
npm ERR! node v5.9.0
npm ERR! npm v3.7.3
npm ERR! The header content contains invalid characters
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
我在/ usr / local / lib / node_modules中设置了正确的权限,如下所示:
sudo chown -R Egen /usr/local/
可能是什么问题?
答案 0 :(得分:0)
错误是错误命令的结果。你输入了:
npm install gulp-jshint -save-dev
这会导致npm
尝试安装软件包gulp
和-save-dev
。
正确的命令应该是:
npm install gulp-jshint --save-dev