教程AngularJS-npm安装错误

我试图按照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 

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

有时npm会给我们带来一些怪异的错误…我发现这些错误的伪解决scheme是手动重buildpackage.json文件。

那么贯穿你的所有依赖:

 npm install packageName --save-dev 

至less可以说是烦人的,但是你可能能够find哪个包是罪魁祸首,因为它会得到最新的版本,也许你正在使用的包版本中有一个版本取决于一些旧版包,不停地大喊大叫。

更新:

这将解决它,但问题在于业力的版本。 根据手机猫github页面上的问题页面。 你正在使用的业力版本存在问题。 改变这个

 "karma": "~0.12", 

而且都是固定的。 现在没有必要去通过每个包….

这真的帮助我: “npm常见问题”在Windows 7上失败(“产卵ENOENT”错误)

确保在Path环境variables中有第一个c:\Windows\System32

遵循以下命令,您可以轻松地使用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

如果你想安装凉亭使用下面的命令

  1. sudo npm install -g bower
  2. 凉亭安装angular度#1.3.0-beta.13