【问题标题】:I'm trying to start a react app but its not starting我正在尝试启动一个反应应用程序,但它没有启动
【发布时间】:2022-03-10 05:26:10
【问题描述】:

我安装了 react 但现在当我尝试启动时它给了我这个错误:

$ npm start

> cred@0.1.0 start
> react-scripts start

The system cannot find the path specified.
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'D:\react-scripts\bin\react-scripts.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

【问题讨论】:

  • 确保您的项目中有node_modules 文件夹。如果没有,您可以执行npm installyarn & 然后尝试运行您的项目。
  • 找到解决方案了吗?
  • @Cyebukayire 是的,我找到了解决方案,我在 d 驱动器文件夹中使用了 react-app,但是当我将它安装在 c 用户驱动器中时,错误消失了

标签: reactjs npm error-handling


【解决方案1】:

几分钟前我遇到了同样的问题, 我试图删除 node modules 文件夹和 package-lock.json 作为其他开发人员建议的解决方案,但这对我不起作用。 所以,在这样做之后,我关闭了我的编辑器(vscode)并重新打开它。 我在另一个新终端中做了npm start,它成功了。

如果上述解决方案不适合您,请尝试This source

【讨论】:

    猜你喜欢
    • 2017-05-29
    • 2021-05-13
    • 2019-01-18
    • 1970-01-01
    • 2014-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多