kat*_*hir 122 node.js npm npm-install angular
创建新的Angular 5项目:
节点版本:8.9.2
npm版本:5.5.1
我的命令是'npm install -g @ angular/cli'
错误是
错误的ERR!解析'... nt-webpack-plugin'附近的JSON输入意外结束:"0"
错误的ERR!可以在以下位置找到此运行的完整日志:C:\ Users\Aashitec\AppData\Roaming \npm-cache_logs\2017-12-06T13_10_10_729Z-debug.log
错误日志是http://www.aashitechno.in/2017-12-06T13_10_10_729Z-debug.log
mce*_*mmy 305
这解决了我
npm cache clean --force
然后运行
npm install -g @ angular/cli @ latest
Moh*_*lal 48
解:
npm cache clean --force
Run Code Online (Sandbox Code Playgroud)
然后再次尝试创建您的应用程序(在创建反应应用程序时)或安装您要安装的内容.
create-react-app myproject
Run Code Online (Sandbox Code Playgroud)
(创建反应应用程序)[在不同操作中可能发生的相同npm问题]
npm install -g @angular/cli@latest
Run Code Online (Sandbox Code Playgroud)
(安装角度cli(或安装任何其他))
它会工作.
这是一个与npm相关的问题,它是关于腐败的缓存.尽管在较新版本的npm中他们实现了自我修复,这通常可以保证没有损坏,但它似乎并不那么有效.
强制清理缓存可以解决问题.
解析其中一个具有json格式的缓存文件时发生错误.缓存位于〜/ .npm/_cacache(在linux中)和%AppData%/ npm-cache(windows)中.对于我当前的npm版本,当我检查时,有三个目录.

这里有一个很好的链接来自doc:https://docs.npmjs.com/cli/cache
[更新]此外,如果它没有解决它,你可以在这里检查这个答案/sf/answers/3513392081/它显示如何更改npm注册表,这可能会有所帮助.检查一下.
Has*_*ul- 18
我用
npm cache clean --force
Run Code Online (Sandbox Code Playgroud)
然后更新 npm
npm i npm@latest -g
Run Code Online (Sandbox Code Playgroud)
然后通常使用您的 npm install 命令
npm install
Run Code Online (Sandbox Code Playgroud)
Rav*_*bad 13
删除 C:\Users\admin\AppData\Roaming\ (windows) 中的 npm 和 npm-cache 文件夹,然后执行 cmd
npm 缓存清除 --force
npm 缓存验证
更新 npm 到最新版本
npm i -g npm
然后创建您的项目 1)Angular
npm i -g @angular/cli@latest
ng新的HelloWorld
2)反应
npm i -g create-react-app
创建反应应用反应应用
小智 8
Npm使用Cache为您下载新包.你需要清除你的npm缓存.使用以下命令清理:
npm cache clean --force
Run Code Online (Sandbox Code Playgroud)
然后通常使用你的npm install命令,例如
npm install -g @angular/cli
Run Code Online (Sandbox Code Playgroud)
小智 6
npm cache clean --force 为我工作
错误已解决:
$ npm install -g gulp npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - 按照https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 npm ERR 上的指南替换它!在 '.../RGs88STtAtiMP3tCiNdU' 附近解析时 JSON 输入意外结束
npm 错误!可以在以下位置找到此运行的完整日志:npm ERR!C:\Users\admin\AppData\Roaming\npm-cache_logs\2018-11-20T07_38_56_733Z-debug.log
这里的 30 个答案都不适合我。我需要:
呼!
如果
npm cache clean --force
Run Code Online (Sandbox Code Playgroud)
不起作用。尝试
npm cache clean --force
npm update
Run Code Online (Sandbox Code Playgroud)
仅此命令就解决了我的问题:
npm cache clean --force
Run Code Online (Sandbox Code Playgroud)
此外,您应该确保使用正确版本的节点。
使用nvm管理节点版本:
nvm list; # check your local versions;
nvm install 10.10.0; # install a new remote version;
nvm alias default 10.10.0; # set the 10.10.0 as the default node version, but you have to restart the terminal to make it take effect;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
99080 次 |
| 最近记录: |