发生未处理的异常:找不到模块“@angular-devkit/build-angular/package.json”需要堆栈

Har*_*kar 0 node.js npm angular-cli

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.
Run Code Online (Sandbox Code Playgroud)

Jam*_*ica 5

刚刚遇到这个问题,我的安装中途中断,导致一些软件包损坏。

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

rm -rf node_modules
rm package-lock.json
npm install --save-dev @angular-devkit/build-angular
Run Code Online (Sandbox Code Playgroud)