node.js - NPM安装错误:Unexpected end of JSON input while parsing near '...nt-webpack-plugin" :"0'

标签 node.js angular npm npm-install

创建新的 Angular 5 项目时:

Node 版本:8.9.2

npm 版本:5.5.1

我的命令是:

npm install -g @angular/cli

错误是:

npm ERR! **Unexpected end of JSON input while parsing near '...nt-webpack-plugin":"0'**
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Aashitec\AppData\Roaming\npm-cache\_logs\2017-12-06T13_10_10_729Z-debug.log

The error log is here

最佳答案

这为我解决了这个问题:

以管理员身份打开 Windows Powershell

npm cache clean --force
npm install -g @angular/cli

https://devblogs.microsoft.com/premier-developer/getting-started-with-node-js-angular-and-visual-studio-code/

关于node.js - NPM安装错误:Unexpected end of JSON input while parsing near '...nt-webpack-plugin" :"0' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53764517/

相关文章:

javascript - ejs中不能for循环

javascript - RxJS/Angular 2 - 拆分可观察数组

node.js - npm 安装失败,因为注册表中缺少包

css - 如何访问本地安装的 NPM 包的 CSS

node.js - http-server-usr/bin/env : node : no such file or directory

node.js - 无需注册应用程序即可进行 Microsoft-Graph API 调用

javascript - Angular.JS : Failed to instantiate module routing due to: Error: $injector:nomod Module 'routing' is not available

node.js - AWS Lambda : Can those event can be integrated with API Management Tools?

Angular 2 多自定义值访问器

angular - 何时使用 [value] 和/或 [ngValue] 或何时不使用?