gpt4 book ai didi

node.js - 使用 npm 安装 express-generator 时出错

转载 作者:行者123 更新时间:2023-12-04 13:13:10 25 4
gpt4 key购买 nike

我尝试使用命令 npm install express-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

最佳答案

WARN 与消息的其余部分无关。仅此而已,警告,并且应该将其提供给使用过时的 deps 的包装维护人员,而不是您。
ERR(s) 是说 npm 无法解析某个地方的 JSON 内容,除此之外别无他法。
在深入查看它显示的日志文件之前,请尝试清理缓存以涵盖缓存条目损坏或不一致以及 npm 崩溃只是因为它试图提高效率的常见情况。
鉴于您使用的是窗口,请以管理员身份打开控制台(CMD 和 Powershell 都应该可以工作,但我没有 Windows 机器 atm)并运行

npm cache clean --force
或者,运行
npm doctor
除其他检查外,还将验证缓存的包并查明损坏或不一致的包。
使用
npm install -g npm
完成后,再次尝试运行 express-generator。

关于node.js - 使用 npm 安装 express-generator 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62859986/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com