反应js应用程序无法启动

时间:2020-04-28 07:32:07

标签: reactjs

我已经使用create-react-app命令创建了react应用程序,但是该应用程序尚未启动,例外是

`Client\web_client\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:983
  throw err;
  ^

Error: Cannot find module 'E:\react-scripts\bin\react-scripts.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! web_client@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the web_client@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Ravi\AppData\Roaming\npm-cache\_logs\2020-04-28T07_24_51_252Z-debug.log`

1 个答案:

答案 0 :(得分:0)

对于您而言,如果遇到此问题,则可能意味着npm没有正确安装该软件包。您可以验证是否存在node_modules / .bin / react-scripts吗?如果没有,请运行rm -rf node_modules并执行npm install,然后重试。

因此,克隆后需要在项目文件夹中运行npm install。之后,其他命令也将起作用。