Angular 如何解决角度项目生成问题

Angular 如何解决角度项目生成问题,angular,Angular,我正在尝试安装一个新的angular starter项目,该项目名为ng new project name,但每次我都会出现以下错误代码 PS H:\Desktop\cool-app> ng serve Could not find module "@angular-devkit/build-angular" from "H:\\Desktop\\cool-app". Error: Could not find module "@angular-devkit/build-angular"

我正在尝试安装一个新的angular starter项目,该项目名为
ng new project name
,但每次我都会出现以下错误代码

PS H:\Desktop\cool-app> ng serve
Could not find module "@angular-devkit/build-angular" from "H:\\Desktop\\cool-app".
Error: Could not find module "@angular-devkit/build-angular" from "H:\\Desktop\\cool-app".
    at Object.resolve (C:\Users\G01205980\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\core\node\resolve.js:141:11)
    at Observable.rxjs_1.Observable [as _subscribe] (C:\Users\G01205980\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\architect\src\architect-legacy.js:153:40)
    at Observable._trySubscribe (C:\Users\G01205980\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:44:25)
    at Observable.subscribe (C:\Users\G01205980\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:30:22)
    at C:\Users\G01205980\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:99:19
    at new Promise (<anonymous>)
    at Observable.toPromise (C:\Users\G01205980\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:97:16)
    at ServeCommand.initialize (C:\Users\G01205980\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:130:86)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
PS H:\Desktop\cool-app> npm install
Terminate batch job (Y/N)?
Terminate batch job (Y/N)? n
PS H:\Desktop\cool-app> npm install
[       ...........] \ postinstall: sill install executeActions
PS H:\Desktop\cool app>ng service
从“H:\\Desktop\\cool app”中找不到模块“@angular devkit/build angular”。
错误:无法从“H:\\Desktop\\cool app”中找到模块“@angular devkit/build angular”。
在Object.resolve(C:\Users\G01205980\AppData\Roaming\npm\node\u modules\@angular\cli\node\u modules\@angular devkit\core\node\resolve.js:141:11)
at Observable.rxjs_1.Observable[作为订阅](C:\Users\G01205980\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular devkit\architect\src\architect legacy.js:153:40)
在可观察状态下。尝试订阅(C:\Users\G01205980\AppData\Roaming\npm\node\U modules\angular\cli\node\U modules\rxjs\internal\Observable.js:44:25)
在Observable.subscribe(C:\Users\G01205980\AppData\Roaming\npm\node\u modules\angular\cli\node\u modules\rxjs\internal\Observable.js:30:22)
在C:\Users\G01205980\AppData\Roaming\npm\node\u modules\@angular\cli\node\u modules\rxjs\internal\Observable.js:99:19
在新的承诺()
在Observable.toPromise(C:\Users\G01205980\AppData\Roaming\npm\node\u modules\angular\cli\node\u modules\rxjs\internal\obbservable.js:97:16)
在ServeCommand.initialize(C:\Users\G01205980\AppData\Roaming\npm\node\u modules\@angular\cli\models\architect command.js:130:86)
在
在进程中。_tick回调(内部/process/next_tick.js:188:7)
位于Function.Module.runMain(Module.js:695:11)
启动时(bootstrap_node.js:188:16)
在bootstrap_node.js:609:3
PS H:\Desktop\cool app>npm安装
是否终止批处理作业(是/否)?
是否终止批处理作业(是/否)?N
PS H:\Desktop\cool app>npm安装
[………]\postinstall:门槛安装执行

看起来没有安装节点依赖项


运行
npm安装
,然后重试

看起来没有安装节点依赖项


运行
npm安装
,然后重试

安装
@angular devkit/build angular
作为开发依赖项

npm install --save-dev @angular-devkit/build-angular
或者


安装
@angular devkit/build angular
作为开发依赖项

npm install --save-dev @angular-devkit/build-angular
或者


您的CLI版本是什么,在此之前是否输出了另一个错误,您是否已将此问题提交给CLI的github存储库,您是否拥有任何管理权限,您键入的命令是什么?给点背景!H:\>node-v v8.10.0 H:\>npm-v 6.9.0的可能重复我的问题完全不同,我的安装过程在这一点上卡住了[……]\postinstall:sill install executeActions,已经半个小时了,但我仍然看到相同的消息。您的CLI版本是什么,在此之前是否输出了另一个错误,您是否已将此问题提交给CLI的github存储库,您是否拥有任何管理权限,您键入的命令是什么?给点背景!H:\>node-v v8.10.0 H:\>npm-v 6.9.0的可能副本我的问题完全不同,我的安装过程在这一点上卡住了[……]\postinstall:sill install executeActions,已经半个小时了,我仍然看到了相同的消息。这应该在评论中建议\这应该在评论中建议\我也做了同样的事情,但在npm安装之后,我看不到这里的进度[……]\postinstall:sill install executeActions.try to clear the cache and try npm cache clear--force and the npm install I try clear npm cache and the npm cache in the Take in the Sample.try to restart the PC:)有时候我遇到同样的问题,我重启了两次,希望这次能正常工作,但运气不佳。我也这么做了,但看不到问题npm安装后此处的进度[………]\postinstall:sill install executeActions.try to clear the cache and try npm cache clear--force and the npm install I try clear npm cache,但它卡在同一个位置。try to restart the PC:)有时我会遇到同样的问题,我重启了它两次,希望这次能正常工作,但运气不佳。