npm ERR!解析附近时JSON输入意外结束 [英] npm ERR! Unexpected end of JSON input while parsing near
问题描述
在运行npm install -g @ angular/cli后创建新的角度项目时,出现以下错误
when creating a new angular project after running npm install -g @angular/cli I am getting the following error
npm ERR!解析附近时JSON输入意外结束 '...:"^ 2.1.0&","ntypescrip"
npm ERR! Unexpected end of JSON input while parsing near '...:"^2.1.0","ntypescrip'
npm ERR!此运行的完整日志可以在以下位置找到:npm ERR!
C:\ Users \ Suraj \ AppData \ Roaming \ npm-cache_logs \ 2019-06-28T06_04_16_049Z-debug.log
软件包安装失败,请参见上文.
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\Suraj\AppData\Roaming\npm-cache_logs\2019-06-28T06_04_16_049Z-debug.log
Package install failed, see above.
推荐答案
尝试:-
从npm @ 5开始,npm缓存会因损坏问题而自我修复,并且保证从缓存中提取的数据是有效的.如果要确保所有内容都一致,请改用"npm cache verify
".如果确定要删除整个缓存,请使用--force重新运行此命令.
Try:-
As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify
' instead. If you're sure you want to delete the entire cache, rerun this command with --force.
第1步)
$ npm cache clean --force
或
$ npm cache verify
第2步)
$ npm install -g @angular/cli@latest
或
尝试卸载并安装angular/cli
第3步)
$ npm install --save-dev @angular/cli@latest
第4步)
删除node_modules
并运行$ npm install
这篇关于npm ERR!解析附近时JSON输入意外结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!