2014-07-15 114 views
0

我只是运行一个基本的mocha安装命令,并在mac终端中抛出错误,请建议查看日志我可以做些什么来获得这个运行,真的很感谢帮助。sudo npm install -g mocha不工作

AUK03154:~ itrmg$ sudo npm install –g mocha 
Password: 
npm ERR! 404 404 Not Found: %E2%80%93g 
npm ERR! 404 
npm ERR! 404 '%E2%80%93g' is not in the npm registry. 
npm ERR! 404 You should bug the author to publish it 
npm ERR! 404 
npm ERR! 404 Note that you can also install from a 
npm ERR! 404 tarball, folder, or http url, or git url. 

npm ERR! System Darwin 13.1.0 
npm ERR! command "node" "/usr/local/bin/npm" "install" "–g" "mocha" 
npm ERR! cwd /Users/itrmg 
npm ERR! node -v v0.10.29 
npm ERR! npm -v 1.4.14 
npm ERR! code E404 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /Users/itrmg/npm-debug.log 
npm ERR! not ok code 0 

感谢 Deepesh

回答

0

如果从其他网页/文本编辑器做到了命令的复制粘贴,还有一些被复制一些不想要的字符。尝试手动输入相同的命令,错误应该消失。

+0

否我输入了命令。 – Max

3

如果你解码%E2%80%93g,你会得到-g。在-g-字符有问题。我复制了字从你的问题,以获取其字符代码:

'–'.charCodeAt(0) 
8211 

然后我打了几许自己:

'-'.charCodeAt(0) 
45 

正如你可以看到你的仪表有不同的字符代码。如果您复制此命令,它应该工作:

npm install -g mocha