【发布时间】:2022-07-14 15:47:27
【问题描述】:
我在尝试运行 npx create-react-app 时注意到了该错误,从那时起我就无法使用 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'
}
【问题讨论】:
-
你能分享你的 tsconfig 吗?
-
哦好的我正在使用js,反应,虽然我已经解决了问题谢谢