在NPM中使用AngularJS进行故障排除

时间:2014-05-23 06:10:52

标签: node.js angularjs

我在尝试启动AngularJS应用时,NPM安装和NPM启动时收到此错误

我已经尝试过了      npm install

和npm start

(我已经用sudo尝试了上述命令)

...

执行命令后,我收到此错误:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'start' ]
2 info using npm@1.2.18
3 info using node@v0.10.15
4 verbose read json /home/raheela/angular-phonecat/package.json
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart angular-phonecat@0.0.0
7 verbose unsafe-perm in lifecycle true
8 silly exec sh "-c" "npm install"
9 silly sh,-c,npm install,/home/raheela/angular-phonecat spawning
10 info angular-phonecat@0.0.0 Failed to exec prestart script
11 error angular-phonecat@0.0.0 prestart: `npm install`
11 error `sh "-c" "npm install"` failed with 1
12 error Failed at the angular-phonecat@0.0.0 prestart script.
12 error This is most likely a problem with the angular-phonecat package,
12 error not with npm itself.
12 error Tell the author that this fails on your system:
12 error     npm install
12 error You can get their info via:
12 error     npm owner ls angular-phonecat
12 error There is likely additional logging output above.
13 error System Linux 3.8.11
14 error command "/usr/bin/nodejs" "/usr/bin/npm" "start"
15 error cwd /home/raheela/angular-phonecat
16 error node -v v0.10.15
17 error npm -v 1.2.18e
18 error code ELIFECYCLE
19 verbose exit [ 1, true ]

谢谢!

编辑:其他信息

> angular-phonecat@0.0.0 prestart /home/raheela/angular-phonecat
> npm install

npm WARN cannot run in wd angular-phonecat@0.0.0 bower install (wd=/home/raheela/angular-phonecat)

> angular-phonecat@0.0.0 start /home/raheela/angular-phonecat
> http-server -p 8000

/usr/bin/env: node: No such file or directory
npm ERR! angular-phonecat@0.0.0 start: `http-server -p 8000`
npm ERR! `sh "-c" "http-server -p 8000"` failed with 127
npm ERR! 
npm ERR! Failed at the angular-phonecat@0.0.0 start 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!     http-server -p 8000
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 Linux 3.8.11
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! cwd /home/raheela/angular-phonecat
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
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/raheela/angular-phonecat/npm-debug.log
    npm ERR! not ok code 0

1 个答案:

答案 0 :(得分:1)

我用

解决了这个问题
sudo apt-get install nodejs-legacy