【问题标题】:An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json' Require stack发生未处理的异常:找不到模块“@angular-devkit/build-angular/package.json”需要堆栈
【发布时间】:2021-06-18 11:57:01
【问题描述】:

ng serve 回复: 发生未处理的异常:找不到模块'@angular-devkit/build-angular/package.json' 需要堆栈:

我试过了 npm install --save-dev @angular-devkit/build-angular

回复:

npm WARN reify please re-try this operation once it completes
npm WARN reify so that the damage can be corrected, or perform
npm WARN reify a fresh install with no lockfile if the problem persists.
npm WARN reify invalid or damaged lockfile detected
npm WARN reify please re-try this operation once it completes
npm WARN reify so that the damage can be corrected, or perform
npm WARN reify a fresh install with no lockfile if the problem persists.
npm WARN reify invalid or damaged lockfile detected
npm WARN reify please re-try this operation once it completes
npm WARN reify so that the damage can be corrected, or perform
npm WARN reify a fresh install with no lockfile if the problem persists.```


Any Solution to solve. Let me know.

【问题讨论】:

    标签: node.js npm angular-cli


    【解决方案1】:

    刚遇到这个,我的安装中途中断,结果导致一些包损坏。

    解决方案非常简单。只需删除 node_modules 文件夹和文件 package-lock.json 然后重新安装模块。完整的命令应该是:

    rm -rf node_modules
    rm package-lock.json
    npm install --save-dev @angular-devkit/build-angular
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-16
      • 1970-01-01
      • 2020-07-06
      • 2021-09-17
      • 1970-01-01
      • 2021-05-24
      • 2018-10-28
      相关资源
      最近更新 更多