NPM开始抛出错误 [英] NPM start throwing errors

查看:403
本文介绍了NPM开始抛出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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


  1. 从github安装git(windows)
  2. 打开git shell.cloned这个问题。 li>
  3. 我已经安装了节点,因此我打开了节点控制台并输入了节点--version.I将v0.10.9

  4. 返回到了git shell。是否将npm安装在angular-phonecat目录中(以安装所有依赖项,如角度js所示: https://docs.angularjs .org / tutorial

我得到以下错误:

  npm ERR!错误:找不到兼容版本:karma-chrome-launcher@'^0.1.4'
npm ERR!有效安装目标:
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:\程序文件(x86)\\\
odejs\\\
ode_modules\
npm\lib\cache.js:709:10)
npm ERR!在C:\程序文件(x86)\\\
odejs\\\
ode_modules\\\
pm\lib\cache.js:631:
10
npm ERR!at saved(C:\\ \\ Program Files(x86)\\\
odejs\\\
ode_modules\\\
pm\\\
ode_modul
es\\\
pm-registry-client\lib\get.js:138:7)
npm ERR!在Object.oncomplete(fs.js:107:15)
npm ER R!如果您需要帮助,您可以通过以下链接报告此日志:
npm ERR!< http://github.com/isaacs/npm/issues>
npm ERR!或通过电子邮件发送至:
npm ERR! < npm-@googlegroups.com>

npm ERR!系统Windows_NT 6.1.7601
npm ERR!命令C:\\ Program Files(x86)\\\\
odejs\\\\\\
ode.exeC:\\Program File
s(x86)\\ nodejs\\\\
ode_modules\\\\
pm\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' cwd C:\ Users \abc\angular-phonecat
npm ERR! node -v v0.10.9
npm ERR! npm -v 1.2.24
npm ERR!
npm ERR!附加的日志记录细节可以在以下位置找到:
npm ERR! C:\ Users \abc\angular-phonecat\\\
pm-debug.log
npm ERR!不好的代码0

我不知道什么是错的?



---- 2014年11月3日更新----我将Node更新到版本v0.10.33,并且在使用angular-phonecat目录上的npm install时开始出现以下错误。

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

lockquote

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

'bower'不被识别为内部或外部命令,
可操作程序或批处理文件。

  npm ERR ! angular-phonecat@0.0.0 postinstall:`bower install` 
npm ERR!退出状态1
npm ERR!
npm ERR!在angular-phonecat@0.0.0安装后脚本失败。
npm ERR!这很可能是angular-phonecat包的问题,​​
npm ERR!而不是npm本身。
npm ERR!告诉作者这在你的系统上失败了:
npm ERR!凉亭安装
npm ERR!您可以通过以下方式获得他们的信息:
npm ERR! npm所有者ls角手机
npm ERR!上面可能还有其他日志记录输出。
npm ERR!系统Windows_NT 6.1.7601
npm ERR!命令C:\\ Program Files(x86)\\\\
odejs\\\\\\
ode.exeC:\\Program File
s(x86)\\ nodejs\\\\
ode_modules\\\\
pm\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' cwd C:\abc\angular-phonecat
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR!代码ELIFECYCLE
npm ERR!
npm ERR!附加的日志记录细节可以在以下位置找到:
npm ERR! C:\abc\angular-phonecat\\\
pm-debug.log
npm ERR! not ok code 0


解决方案

打开package.json文件并改变karma-chrome-launcher:^ 0.1.4和karma-chrome-launcher: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版。



如果仍然不行,试试 npm cache clear >然后 npm install






如果您的问题是代理,您可以尝试npm配置设置代理和npm配置设置https-proxy描述ed here jjasonclark.com/how-to-setup-node-behind-web -proxy






希望这有助于您。



< hr>

注意 :我已经尝试过npm install这个仓库的全新副本,它可以工作,尽管不是Windows和版本0.10.28和1.4。 9。所以严格来说,package.json是正确的。


Hi I am trying to install and run angular-phonecat project.

  1. install git ( windows ) from github
  2. Opened git shell.cloned the probject.
  3. I have node already installed so I opened node console and typed node --version.I got v0.10.9
  4. back to git shell. did npm install in the angular-phonecat directory ( to install all dependencies as angular js suggests here:https://docs.angularjs.org/tutorial

I got following error then:

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

I have no idea what is wrong ?

----Nov 3 2014 update----I updated Node to version v0.10.33 and started getting below error when trying npm install on angular-phonecat directory.

npm WARN package.json karma-chrome-launcher@0.1.5 No README data

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

'bower' is not recognized as an internal or external command, operable program or 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

解决方案

Open your package.json file and change "karma-chrome-launcher": "^0.1.4" with "karma-chrome-launcher": "0.1.4", that is, remove the caret. Same with all the dependencies that use that notation. You can see the meaning of the version numbers here.

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

The ^ character means "Compatible with".

You can also try to upgrade node and npm, versions 0.10.9 and 1.2.24 are quite old now, and the ^ character is not supported in that version.

Caret was first available in npm from August 2013 and became the default save prefix 6 months later in February 2014.

Which is npm version 1.3.7.

If it still does not work try npm cache clear and then npm install again.


If your problem is the proxy you can try npm config set proxy and npm config set https-proxy as described here jjasonclark.com/how-to-setup-node-behind-web-proxy.


Hope this helps.


Note: I have tried npm install on a fresh copy of this repository myself and it works, although not Windows and versions 0.10.28 and 1.4.9 respectively. So the package.json is correct, strictly speaking.

这篇关于NPM开始抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆