发生未处理的异常:找不到模块“ @ angular-devkit / build-angular”

时间:2019-12-02 10:23:44

标签: javascript node.js angular typescript single-page-application

在运行ng server或ng serve终端命令时,出现此问题:

发生未处理的异常:找不到模块“ @ angular-devkit / build-angular”

3 个答案:

答案 0 :(得分:2)

检入package.json以查看您的devDependencies部分中是否有此软件包

"devDependencies": {
    "@angular-devkit/build-angular": "~0.803.18"
}

如果存在,尝试

删除package-lock.json或yarn-lock.json

运行

npm cache clean --force

然后运行

npm i

答案 1 :(得分:0)

尝试

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

答案 2 :(得分:0)

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

  

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

  

纱线添加@ angular-devkit / build-angular --dev