简体   繁体   中英

tutorial AngularJS- npm install error

I'm trying to follow the steps on the angularjs website, but I encountered an error.

This is the content of my package.json:

$ cat package.json

{
"name": "angularjs-seed",
"description": "A starter project for AngularJS",
"repository": "https://github.com/angular/angular-seed",
"devDependencies": {
"phantomjs": "~1.9",
"karma": "~0.10.4",
"karma-junit-reporter": "~0.1",
"karma-jasmine": "~0.1.3",
"karma-ng-scenario": "~0.1",
"karma-chrome-launcher": "~0.1.0",
"karma-firefox-launcher": "~0.1.0",
"karma-html2js-preprocessor": "~0.1.0",
"karma-requirejs": "~0.1.0",
"karma-coffee-preprocessor": "~0.1.0",
"karma-phantomjs-launcher": "~0.1.0",
"karma-script-launcher": "~0.1.0"
 }
}

This is the error when I try to do $npm install

nisevi@nisevi-IdeaPad angular-phonecat (master):$ npm install
npm http GET https://registry.npmjs.org/phantomjs
npm http GET https://registry.npmjs.org/karma
npm http 304 https://registry.npmjs.org/karma
npm http 304 https://registry.npmjs.org/phantomjs
npm http GET https://registry.npmjs.org/adm-zip/0.2.1
npm http GET https://registry.npmjs.org/kew
npm http GET https://registry.npmjs.org/ncp/0.4.2
npm http GET https://registry.npmjs.org/mkdirp/0.3.5
npm http GET https://registry.npmjs.org/which
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/npmconf/0.0.24
npm http GET https://registry.npmjs.org/di
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/chokidar
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/http-proxy
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/q
npm http GET https://registry.npmjs.org/colors/0.6.0-1
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/useragent
npm http GET https://registry.npmjs.org/log4js
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/connect
npm http 304 https://registry.npmjs.org/which
npm http 304 https://registry.npmjs.org/kew
npm http 304 https://registry.npmjs.org/mkdirp/0.3.5
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/npmconf/0.0.24
npm http 304 https://registry.npmjs.org/di
npm http 304 https://registry.npmjs.org/adm-zip/0.2.1
npm http 304 https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/chokidar
npm http 304 https://registry.npmjs.org/http-proxy
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/ncp/0.4.2
npm http GET https://registry.npmjs.org/config-chain
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/once
npm http GET https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/ini
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/q
npm http 304 https://registry.npmjs.org/useragent
npm http 304 https://registry.npmjs.org/colors/0.6.0-1
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/log4js
npm http 304 https://registry.npmjs.org/connect
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/config-chain
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/osenv/0.0.3
npm http 304 https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/once

> chokidar@0.8.1 postinstall /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/chokidar
> node setup-deps.js

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm http 304 https://registry.npmjs.org/ini
npm ERR! Error: ENOENT, utime '/home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/log4js/lib/debug.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/npm-debug.log npm

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/log4js/lib/debug.js
npm ERR! fstream_path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/log4js/lib/debug.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call utimes
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:305:19
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, utime '/home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/mime/types/node.types'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/npm-debug.log npm

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/mime/types/node.types
npm ERR! fstream_path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/mime/types/node.types
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call utimes
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:305:19
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, utime '/home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/optimist/example/line_count_options.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/npm-debug.log npm

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/optimist/example/line_count_options.js
npm ERR! fstream_path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/optimist/example/line_count_options.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call utimes
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:305:19
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! EEXIST, mkdir '/home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/glob/test'
File exists: /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/glob/test
Move it away, and try again. 

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/glob/test
npm ERR! fstream_path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/glob/test/pause-resume.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/lib/nodejs/mkdirp/index.js:45:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! EEXIST, mkdir '/home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/connect/lib/middleware'
File exists: /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/connect/lib/middleware
Move it away, and try again. 

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/connect/lib/middleware
npm ERR! fstream_path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/connect/lib/middleware/favicon.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/lib/nodejs/mkdirp/index.js:45:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/http-proxy/examples/http/concurrent-proxy.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/npm-debug.log npm

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/http-proxy/examples/http/concurrent-proxy.js
npm ERR! fstream_path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/http-proxy/examples/http/concurrent-proxy.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! chokidar@0.8.1 postinstall: `node setup-deps.js`
npm ERR! `sh "-c" "node setup-deps.js"` failed with 127
npm ERR! 
npm ERR! Failed at the chokidar@0.8.1 postinstall script.
npm ERR! This is most likely a problem with the chokidar package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node setup-deps.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls chokidar
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR! Error: ENOENT, lstat '/home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/minimatch/test/defaults.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/npm-debug.log npm

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/minimatch/test/defaults.js
npm ERR! fstream_path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/minimatch/test/defaults.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/socket.io/lib/parser.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/npm-debug.log npm

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/socket.io/lib/parser.js
npm ERR! fstream_path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/socket.io/lib/parser.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/q/q.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/npm-debug.log npm

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/q/q.js
npm ERR! fstream_path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/q/q.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/coffee-script/lib/coffee-script/command.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/npm-debug.log npm

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/coffee-script/lib/coffee-script/command.js
npm ERR! fstream_path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/coffee-script/lib/coffee-script/command.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/useragent/lib/regexps.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/npm-debug.log npm

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/useragent/lib/regexps.js
npm ERR! fstream_path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/useragent/lib/regexps.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http GET https://registry.npmjs.org/abbrev
npm ERR! Error: ENOENT, lstat '/home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/lodash/dist/lodash.compat.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/npm-debug.log npm

npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/lodash/dist/lodash.compat.js
npm ERR! fstream_path /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/karma/node_modules/lodash/dist/lodash.compat.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http GET https://registry.npmjs.org/proto-list
npm http 304 https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/proto-list

> phantomjs@1.9.7-1 install /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/node_modules/phantomjs
> node install.js

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/nisevi/Documents/proyects/proyects_angular/angular-phonecat/npm-debug.log
npm ERR! not ok code 0

If someone can help me, I'm gonna be very grateful!!

Sometimes npm gives us spooky errors... A pseudo solution I have found to these errors is to manually rebuild the package.json file.

So running through all your dependancies:

npm install packageName --save-dev

It is annoying to say the least but you might be able to find which package is the culprit, because it will get the newest version, maybe there is a version in the package version you are using that depends on some legacy package as it seems to keep yelling about.

UPDATE:

This will solve it however the problem lies in the version of karma. According to the issues page on the phone-cat github page. There is a problem with karma version you are using. Change this to

"karma": "~0.12",

and all is fixed. Now there is no need to go through each package....

This really helped me: "npm faq" fails on Windows 7 ("spawn ENOENT" errors)

Make sure you have the c:\\Windows\\System32 as the first on the Path environment variable.

Follow the following commands you can easily get installed with angularJS

  1. sudo apt-get install nodejs
  2. List item
  3. sudo apt-get install -y python-software-properties
  4. sudo add-apt-repository ppa:chris-lea/node.js
  5. sudo apt-get update
  6. npm config set prefix /usr/local

If you want to install bower use following commands

  1. sudo npm install -g bower
  2. bower install angular#1.3.0-beta.13

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