遵循本指南:
https://docs.microsoft.com/en-us/aspnet/core/client-side/spa/angular?view=aspnetcore-2.2&tabs=visual-studio
我已经跑了
dotnet new angular -o HelloWorld
,然后在Visual Studio中打开.csproj。
接下来,我运行生成过程并开始调试,现在面临aggregateexception错误:
AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: npm ERR! Error: ENOENT, open 'E:\DELETEME\HelloWorld\ClientApp\node_modules\start\package.json'
值得注意的:
package.json
文件实际位于
E:\DELETEME\HelloWorld\ClientApp\package.json
,
不是
E:\DELETEME\HelloWorld\ClientApp\node_modules\start\package.json
有关版本的一些详细信息:
10错误节点-v0.10.31
11错误NPM-V 1.4.9
npm-debug.log中的完整日志:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\\\node\\node',
1 verbose cli 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'start',
1 verbose cli '--',
1 verbose cli '--port',
1 verbose cli '52426' ]
2 info using npm@1.4.9
3 info using node@v0.10.31
4 verbose node symlink C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\\node\node
5 error Error: ENOENT, open 'E:\DELETEME\Testing\ClientApp\node_modules\start\package.json'
6 error If you need help, you may report this *entire* log,
6 error including the npm and node versions, at:
6 error <http://github.com/npm/npm/issues>
7 error System Windows_NT 6.2.9200
8 error command "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\\\node\\node" "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "start" "--" "--port" "52426"
9 error cwd E:\DELETEME\Testing\ClientApp
10 error node -v v0.10.31
11 error npm -v 1.4.9
12 error path E:\DELETEME\Testing\ClientApp\node_modules\start\package.json
13 error code ENOENT
14 error errno 34
15 verbose exit [ 34, true ]
昨天当我使用上面的模板开始一个新的角度项目时,我没有面对上面的错误。