教程AngularJS- npm安装错误

时间:2014-03-19 04:13:42

标签: node.js angularjs npm phantomjs karma-runner

我试图按照angularjs网站上的步骤操作,但我遇到了错误。

这是我的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"
 }
}

当我尝试$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

如果有人可以帮助我,我会非常感激!!

3 个答案:

答案 0 :(得分:4)

有时候npm会给我们带来诡异的错误......我发现这些错误的伪解决方案是手动重建package.json文件。

贯穿你所有的依赖:

npm install packageName --save-dev

至少可以说是烦人的但是你可以找到哪个软件包是罪魁祸首,因为它会得到最新的版本,也许你正在使用的软件包版本中有一个版本取决于一些传统的软件包它似乎一直在大喊大叫。

更新:

这将解决它,但问题在于业力的版本。根据phone-cat github页面上的问题页面。您正在使用的业力版本存在问题。将其更改为

"karma": "~0.12",

一切都是固定的。现在没有必要通过每个包....

答案 1 :(得分:0)

这真的帮助了我:"npm faq" fails on Windows 7 ("spawn ENOENT" errors)

确保c:\Windows\System32环境变量上的{{1>}为第一个

答案 2 :(得分:-1)

按照以下命令,您可以使用angularJS轻松安装

  1. sudo apt-get install nodejs
  2. 列表项
  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
  7. 如果您想使用以下命令安装bower

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