Poo*_*rna 5 node.js npm express express-generator npm-install
我尝试使用命令 npm installexpress-generator 安装express-generator,但出现以下错误。我在网上搜索并找不到任何有用的答案。
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! Unexpected end of JSON input while parsing near '...DHZShvBYWKIIktsiBUuRD'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ASUS\AppData\Roaming\npm-cache\_logs\2020-07-12T10_29_10_754Z-debug.log
Run Code Online (Sandbox Code Playgroud)
WARN 与消息的其余部分无关。只是这样,一个警告,并且应该将其提供给使用过时的 deps 的软件包管理人员,而不是您。
ERR(s) 表示 npm 无法在某处解析 JSON 内容,仅此而已。
在深入研究它向您显示的日志文件之前,请尝试清理缓存以涵盖缓存条目损坏或不一致以及 npm 崩溃的常见情况,因为它试图提高效率。
假设您使用的是 Windows,请以管理员身份打开控制台(CMD 和 Powershell 都应该可以工作,但我没有 Windows 机器 atm)并运行
npm cache clean --force
Run Code Online (Sandbox Code Playgroud)
或者,运行
npm doctor
Run Code Online (Sandbox Code Playgroud)
除其他检查外,还将验证缓存的包并查明损坏或不一致的包。
使用以下命令将您的 npm 版本更新到最新版本也没什么坏处
npm install -g npm
Run Code Online (Sandbox Code Playgroud)
完成后,尝试再次运行express-generator。
| 归档时间: |
|
| 查看次数: |
21236 次 |
| 最近记录: |