角度2 - npm错误

时间:2016-02-15 14:54:08

标签: npm angular

我正在关注5 Min Quickstart - js - Angular 2指南,并在调用“npm start”后发现一个奇怪的错误:

.slider-pager { display:none; }

更新:安装“npm install lite-server -g”时,我收到了以下错误:

> angular2-quickstart@1.0.0 start C:\Users\stavalfi\Desktop\plunkerExample
> npm run lite


> angular2-quickstart@1.0.0 lite C:\Users\stavalfi\Desktop\plunkerExample
> lite-server

'lite-server' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js
" "run" "lite"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! angular2-quickstart@1.0.0 lite: `lite-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-quickstart@1.0.0 lite script 'lite-server'.
npm ERR! This is most likely a problem with the angular2-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     lite-server
npm ERR! You can get their info via:
npm ERR!     npm owner ls angular2-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\stavalfi\Desktop\plunkerExample\npm-debug.log

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js
" "start"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! angular2-quickstart@1.0.0 start: `npm run lite`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-quickstart@1.0.0 start script 'npm run lite'.
npm ERR! This is most likely a problem with the angular2-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run lite
npm ERR! You can get their info via:
npm ERR!     npm owner ls angular2-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\stavalfi\Desktop\plunkerExample\npm-debug.log

2 个答案:

答案 0 :(得分:0)

错误代码ENOENT表示"没有此类文件或目录"。

您应该检查文件C:\Users\stavalfi\package.json是否存在且应用程序可以访问...您是否在右侧文件夹中执行命令?

答案 1 :(得分:0)

你试过更新npm吗?我在5分钟的快速启动时遇到了一些其他问题,但在我更新了npm后,我可以运行npm start而没有任何错误。