NPM 安装错误 (Angular 6)
NPM Insall error (Angular 6)
我有一个 Angular 6 项目,当我尝试执行它时,它抛出以下错误:
Could not find module "@angular-devkit/build-angular" from "C:\Users\fernando.cavalcante\Desktop\Fernando_Backup\VisualStudio2017\Projects\GerenciadorDiretorioAPI\Presentattion".
Error: Could not find module "@angular-devkit/build-angular" from ...
我尝试更新软件包,但是当我使用 运行 npm install
命令时,cmd 抛出以下消息:
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\me\Desktop\Folder1\Projects\My.Project\Developing[=12=] - Presentation\My.Project\node_modules\.staging\es5-ext-b75d419b\test\reg-exp\#\sticky\is-implemented.js'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 403 Forbidden: fsevents@https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz
npm ERR! code EINTEGRITY
npm ERR! sha1-PFtv1/beCRQmkCfwPAlGdY92c6Q= integrity checksum failed when using sha1: wanted sha1-PFtv1/beCRQmkCfwPAlGdY92c6Q= but got sha1-pMeCeEFUzmIX1LXY6ZTg7bwjcDY=. (4472399 bytes)
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\me\AppData\Roaming\npm-cache\_logs18-05-18T13_11_28_030Z-debug.log
我搜索了一些解决方案 , here, here and here,尝试重新安装 Node,重新安装 Angular,甚至搜索了一些未解决的问题,但对我没有任何帮助。
我也尝试了 和 运行 npm clean cache -f
但没有成功。
我不知道如何进行。
我正在使用 Angular CLI:6.0.1 和节点:8.11.2
删除您的 node_modules
文件夹。 rm -rf node_modules
删除您的 package.lock.json 文件。
可能想要更新您的 angular cli。
npm install -g @angular/cli@latest
或先 运行 npm uninstall -g @angular/cli
然后 npm install -g @angular/cli@latest
现在 运行 npm 安装。
安装开发依赖。
npm install --save-dev @angular-devkit/build-angular
是Angular6
中的新包
删除package-lock.json,即使有@angular/cli @版本 7,我正在使用 版本 6,并且遇到了同样的问题。删除 package-lock.json 为我修复了这个错误。没有必要删除 node_modules 因为它甚至不会安装任何包,只会抛出错误。
我有一个 Angular 6 项目,当我尝试执行它时,它抛出以下错误:
Could not find module "@angular-devkit/build-angular" from "C:\Users\fernando.cavalcante\Desktop\Fernando_Backup\VisualStudio2017\Projects\GerenciadorDiretorioAPI\Presentattion".
Error: Could not find module "@angular-devkit/build-angular" from ...
我尝试更新软件包,但是当我使用 运行 npm install
命令时,cmd 抛出以下消息:
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\me\Desktop\Folder1\Projects\My.Project\Developing[=12=] - Presentation\My.Project\node_modules\.staging\es5-ext-b75d419b\test\reg-exp\#\sticky\is-implemented.js'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 403 Forbidden: fsevents@https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz
npm ERR! code EINTEGRITY
npm ERR! sha1-PFtv1/beCRQmkCfwPAlGdY92c6Q= integrity checksum failed when using sha1: wanted sha1-PFtv1/beCRQmkCfwPAlGdY92c6Q= but got sha1-pMeCeEFUzmIX1LXY6ZTg7bwjcDY=. (4472399 bytes)
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\me\AppData\Roaming\npm-cache\_logs18-05-18T13_11_28_030Z-debug.log
我搜索了一些解决方案
我也尝试了 npm clean cache -f
但没有成功。
我不知道如何进行。
我正在使用 Angular CLI:6.0.1 和节点:8.11.2
删除您的 node_modules
文件夹。 rm -rf node_modules
删除您的 package.lock.json 文件。
可能想要更新您的 angular cli。
npm install -g @angular/cli@latest
或先 运行 npm uninstall -g @angular/cli
然后 npm install -g @angular/cli@latest
现在 运行 npm 安装。
安装开发依赖。
npm install --save-dev @angular-devkit/build-angular
是Angular6
中的新包删除package-lock.json,即使有@angular/cli @版本 7,我正在使用 版本 6,并且遇到了同样的问题。删除 package-lock.json 为我修复了这个错误。没有必要删除 node_modules 因为它甚至不会安装任何包,只会抛出错误。