就像几周前,我通过命令npm i -g path全局安装了本地包。从今天开始,它运行得很好。我再次尝试使用npm i -g路径,得到以下错误:
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path "user"\AppData\Roaming\npm\node_modules\.staging\js2cp-28011c0d\node_modules\fs-extra
npm ERR! dest "user"\AppData\Roaming\npm\node_modules\.staging\fs-extra-d19736e5
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename '"user"\AppData\Roaming\npm\node_modules\.staging\js2cp-28011c0d\node_modules\fs-extra' -> '"user"\AppData\Roaming\npm\node_modules\.staging\fs-extra-d19736e5'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! "user"\AppData\Roaming\npm-cache\_logs\2021-07-27T07_39_50_112Z-debug.log我想进入"user"\AppData\Roaming\npm\node_modules\,但在node_modules文件夹中找不到./.staging文件夹。
你知道是什么导致了这个错误以及如何修复它吗?
发布于 2021-07-27 16:04:47
你可以做几件事来快速修复这个问题
a.清理缓存:npm cache clean --force
b.删除package.lock
如果这两个都不能帮到你,我需要一点小技巧
c.删除node-modules,然后npm install againe (希望这会有所帮助)
d.删除带有npm的节点并重新安装
大多数情况下,a和b将为您解决问题!
https://stackoverflow.com/questions/68540875
复制相似问题