NPM开始抛出错误

嗨,我正在尝试安装并运行angular-phonecat项目。

  1. 从github安装git(windows)
  2. 打开git shell.cloned的问题。
  3. 我有节点已经安装,所以我打开节点控制台和types节点 – 版本。我得到v0.10.9
  4. 回到git shell。 做npm安装在angular-phonecat目录(安装所有的依赖关系,如angular度js在这里build议: https ://docs.angularjs.org/tutorial

我得到以下错误,然后:

npm ERR! Error: No compatible version found: karma-chrome-launcher@'^0.1.4' npm ERR! Valid install targets: npm ERR! ["0.0.1","0.0.2","0.1.0","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5"] npm ERR! at installTargetsError (C:\Program Files (x86)\nodejs\node_modules\ npm\lib\cache.js:709:10) npm ERR! at C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.js:631: 10 npm ERR! at saved (C:\Program Files (x86)\nodejs\node_modules\npm\node_modul es\npm-registry-client\lib\get.js:138:7) npm ERR! at Object.oncomplete (fs.js:107:15) npm ERR! If you need help, you may report this log at: npm ERR! <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm ERR! <npm-@googlegroups.com> npm ERR! System Windows_NT 6.1.7601 npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" npm ERR! cwd C:\Users\abc\angular-phonecat npm ERR! node -v v0.10.9 npm ERR! npm -v 1.2.24 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\Users\abc\angular-phonecat\npm-debug.log npm ERR! not ok code 0 

我不知道什么是错的?

—- 11月3日2014更新—-我更新节点版本v0.10.33,并开始得到以下错误时尝试npm安装在angular-phonecat目录。

npm WARN package.json karma-chrome-launcher@0.1.5没有README数据

angular-phonecat@0.0.0 postinstall C:\ abc \ angular-phonecat bower install

“凉亭”不被识别为内部或外部命令,可操作程序或batch file。

 npm ERR! angular-phonecat@0.0.0 postinstall: `bower install` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular-phonecat@0.0.0 postinstall script. npm ERR! This is most likely a problem with the angular-phonecat package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! bower install npm ERR! You can get their info via: npm ERR! npm owner ls angular-phonecat npm ERR! There is likely additional logging output above. npm ERR! System Windows_NT 6.1.7601 npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" npm ERR! cwd C:\abc\angular-phonecat npm ERR! node -v v0.10.33 npm ERR! npm -v 1.4.28 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\abc\angular-phonecat\npm-debug.log npm ERR! not ok code 0 

打开你的package.json文件,用“karma-chrome-launcher”改变“karma-chrome-launcher”:“^ 0.1.4”:“0.1.4”,即删除插入符号。 与使用该表示法的所有依赖关系相同。 你可以在这里看到版本号的含义。

https://www.npmjs.org/doc/files/package.json.html#dependencies

^字符表示“兼容”。

你也可以尝试升级node和npm,版本0.10.9和1.2.24现在已经很老了, 在那个版本中不支持 ^字符。

Caret于2013年8月首次在npm上市,并于2014年2月6个月后成为默认保存前缀。

这是npm版本1.3.7。

如果仍然不能正常工作,请尝试npmcaching清除 ,然后再次安装npm


如果你的问题是代理,你可以尝试npmconfiguration设置代理和npmconfiguration设置HTTPS代理,如这里所述jjasonclark.com/how-to-setup-node-behind-web-proxy 。


希望这可以帮助。


:我已经尝试npm安装在这个存储库的新鲜的副本本身,它的工作原理,虽然不是Windows和版本0.10.28和1.4.9分别。 所以package.json严格来说是正确的。