npm安装未安装’@angular-devkit/build-angular:dev-server’

huangapple go评论65阅读模式
英文:

npm install not installing '@angular-devkit/build-angular:dev-server"

问题

在一个MEAN课程项目中,我无法运行它,因为我遇到以下错误:

$ npm run start

> mean-course@0.0.0 start
> ng serve

可能未安装Node包。尝试使用 'npm install' 进行安装。
错误:无法找到 '@angular-devkit/build-angular:dev-server' 构建程序的节点包。

所以我进入package.json文件,在“devDependencies”下添加以下行:

"@angular-devkit/build-angular:dev-server": "15.1.6", 

然后我尝试运行npm run start,但我仍然收到以下错误,指出依赖项仍未安装:


> mean-course@0.0.0 start
> ng serve

可能未安装Node包。尝试使用 'npm install' 进行安装。
错误:无法找到 '@angular-devkit/build-angular:dev-server' 构建程序的节点包。

有人遇到相同的问题或知道解决方法吗?任何帮助将不胜感激,谢谢!

英文:

On a MEAN course project I cannot run it because I am getting the below error:

$ npm run start

> mean-course@0.0.0 start
> ng serve

Node packages may not be installed. Try installing with 'npm install'.
Error: Could not find the '@angular-devkit/build-angular:dev-server' builder's node package.

So I go into the package.json file and under "devDependencies" add the line:

"@angular-devkit/build-angular:dev-server": "15.1.6", 

Then I try to run npm run start and I get the error below stating that the dependency is still not installed:


> mean-course@0.0.0 start
> ng serve

Node packages may not be installed. Try installing with 'npm install'.
Error: Could not find the '@angular-devkit/build-angular:dev-server' builder's node package.

Anybody have the same problem or know a solution? Any help would be appreciated thank you!

答案1

得分: 1

尝试在您的终端中运行以下命令:

npm i -D @angular-devkit/build-angular
英文:

Try this command in your terminal:

npm i -D @angular-devkit/build-angular

答案2

得分: 1

尝试运行以下命令:

npm install --save-dev @angular-devkit/build-angular
英文:

Try to run this

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

huangapple
  • 本文由 发表于 2023年2月16日 18:22:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/75470842.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定