简体   繁体   中英

NPM start throwing errors

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM