Angular2 QuickStart npm start 在第二天不起作用
Angular2 QuickStart npm start is not working on it's next day
我试过了Angular2 QuickStart。为了执行这个,我使用了 npm start
。第一次尝试它工作正常。但是在第二天,当我尝试使用 npm start
运行 时,它会抛出这样的错误:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@3.10.10
3 info using node@v6.11.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle angular-quickstart@1.0.0~prestart: angular-quickstart@1.0.0
6 verbose lifecycle angular-quickstart@1.0.0~prestart: unsafe-perm in lifecycle true
7 verbose lifecycle angular-quickstart@1.0.0~prestart: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\wamp64\www\prakash_angular3\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\wamp64\bin\php\php5.6.25;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs\;C:\Users\vis-2113\AppData\Roaming\npm
8 verbose lifecycle angular-quickstart@1.0.0~prestart: CWD: C:\wamp64\www\prakash_angular3
9 silly lifecycle angular-quickstart@1.0.0~prestart: Args: [ '/d /s /c', 'npm run build' ]
10 silly lifecycle angular-quickstart@1.0.0~prestart: Returned: code: 1 signal: null
11 info lifecycle angular-quickstart@1.0.0~prestart: Failed to exec prestart script
12 verbose stack Error: angular-quickstart@1.0.0 prestart: `npm run build`
12 verbose stack Exit status 1
12 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
12 verbose stack at emitTwo (events.js:106:13)
12 verbose stack at EventEmitter.emit (events.js:191:7)
12 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
12 verbose stack at emitTwo (events.js:106:13)
12 verbose stack at ChildProcess.emit (events.js:191:7)
12 verbose stack at maybeClose (internal/child_process.js:920:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
13 verbose pkgid angular-quickstart@1.0.0
14 verbose cwd C:\wamp64\www\prakash_angular3
15 error Windows_NT 6.1.7601
16 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
17 error node v6.11.4
18 error npm v3.10.10
19 error code ELIFECYCLE
20 error angular-quickstart@1.0.0 prestart: `npm run build`
20 error Exit status 1
21 error Failed at the angular-quickstart@1.0.0 prestart script 'npm run build'.
21 error Make sure you have the latest version of node.js and npm installed.
21 error If you do, this is most likely a problem with the angular-quickstart package,
21 error not with npm itself.
21 error Tell the author that this fails on your system:
21 error npm run build
21 error You can get information on how to open an issue for this project with:
21 error npm bugs angular-quickstart
21 error Or if that isn't available, you can get their info via:
21 error npm owner ls angular-quickstart
21 error There is likely additional logging output above.
22 verbose exit [ 1, true ]
我该如何解决这个问题?
在您的 QuickStart 目录中打开 2 cmd windows。
Window #1:
npm run build:watch
那么,
Window#2:
npm run serve
然后它将在浏览器中打开并按预期工作。
我试过了Angular2 QuickStart。为了执行这个,我使用了 npm start
。第一次尝试它工作正常。但是在第二天,当我尝试使用 npm start
运行 时,它会抛出这样的错误:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@3.10.10
3 info using node@v6.11.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle angular-quickstart@1.0.0~prestart: angular-quickstart@1.0.0
6 verbose lifecycle angular-quickstart@1.0.0~prestart: unsafe-perm in lifecycle true
7 verbose lifecycle angular-quickstart@1.0.0~prestart: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\wamp64\www\prakash_angular3\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\wamp64\bin\php\php5.6.25;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs\;C:\Users\vis-2113\AppData\Roaming\npm
8 verbose lifecycle angular-quickstart@1.0.0~prestart: CWD: C:\wamp64\www\prakash_angular3
9 silly lifecycle angular-quickstart@1.0.0~prestart: Args: [ '/d /s /c', 'npm run build' ]
10 silly lifecycle angular-quickstart@1.0.0~prestart: Returned: code: 1 signal: null
11 info lifecycle angular-quickstart@1.0.0~prestart: Failed to exec prestart script
12 verbose stack Error: angular-quickstart@1.0.0 prestart: `npm run build`
12 verbose stack Exit status 1
12 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
12 verbose stack at emitTwo (events.js:106:13)
12 verbose stack at EventEmitter.emit (events.js:191:7)
12 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
12 verbose stack at emitTwo (events.js:106:13)
12 verbose stack at ChildProcess.emit (events.js:191:7)
12 verbose stack at maybeClose (internal/child_process.js:920:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
13 verbose pkgid angular-quickstart@1.0.0
14 verbose cwd C:\wamp64\www\prakash_angular3
15 error Windows_NT 6.1.7601
16 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
17 error node v6.11.4
18 error npm v3.10.10
19 error code ELIFECYCLE
20 error angular-quickstart@1.0.0 prestart: `npm run build`
20 error Exit status 1
21 error Failed at the angular-quickstart@1.0.0 prestart script 'npm run build'.
21 error Make sure you have the latest version of node.js and npm installed.
21 error If you do, this is most likely a problem with the angular-quickstart package,
21 error not with npm itself.
21 error Tell the author that this fails on your system:
21 error npm run build
21 error You can get information on how to open an issue for this project with:
21 error npm bugs angular-quickstart
21 error Or if that isn't available, you can get their info via:
21 error npm owner ls angular-quickstart
21 error There is likely additional logging output above.
22 verbose exit [ 1, true ]
我该如何解决这个问题?
在您的 QuickStart 目录中打开 2 cmd windows。
Window #1:
npm run build:watch
那么,
Window#2:
npm run serve
然后它将在浏览器中打开并按预期工作。