当我试图运行npx创建反应应用程序时,我注意到了这个错误,从那以后,我一直无法在任何事情上使用npm。我已经不加密和重新安装节点,但同样的错误不断出现。
错误:
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN logfile could not be created: Error: EPERM: operation not permitted, open 'C:\Users\DevSayae\AppData\Roaming\npm-cache\_logs\2022-07-07T07_54_40_928Z-debug-0.log'
node:internal/modules/cjs/loader:353
const err = new Error(
^
Error: Cannot find module 'C:\Users\HP PC\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:353:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\HP PC\AppData\Roaming\npm\node_modules\npm\node_modules\cacache\lib\util\fix-owner.js:7:18)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
code: 'MODULE_NOT_FOUND',
path: 'C:\\Users\\HP PC\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\promise-inflight\\package.json',
requestPath: 'promise-inflight'
}
发布于 2022-07-14 07:47:27
通过在我的电脑上走上这条路,我就能解决这个问题:
‘c:\User\HP PC\AppData\漫游\npm’,
删除npm文件夹,然后从我的Pc中删除所有node.js,最后再重新安装node.js。在那之后一切都很好
https://stackoverflow.com/questions/72894594
复制相似问题