在 react js 中运行 npm start 时出错

时间:2021-06-29 14:15:06

标签: node.js reactjs npm

我使用 npx

创建了一个 React 项目
npx create-react-app react-authentication

在那之后当我跑

npm start

它抛出一个错误说:

internal/modules/cjs/loader.js:456
      throw e;
      ^

Error: Cannot find module '/home/astraCreateDataProperty/react-authentication/node_modules/es-abstract/2020/CreateDataProperty.js'
    at createEsmNotFoundErr (internal/modules/cjs/loader.js:929:15)
    at finalizeEsmResolution (internal/modules/cjs/loader.js:922:15)
    at resolveExports (internal/modules/cjs/loader.js:450:14)
    at Function.Module._findPath (internal/modules/cjs/loader.js:490:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:888:27)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/home/astra*/react-authentication/node_modules/object.getownpropertydescriptors/implementation.js:3:26)
    at Module._compile (internal/modules/cjs/loader.js:1085:14) {
  code: 'MODULE_NOT_FOUND',
  path: '/home/astra*/react-authentication/node_modules/es-abstract/package.json'
}

我尝试了一些方法来解决这个问题

  1. rm -rf node_modules
  2. rm -rf package-lock.json
  3. npm cache clean --force
  4. npm install

但是,同样的错误仍然存​​在。这个错误的原因是什么?

0 个答案:

没有答案