admin管理员组文章数量:1317906
i used npx create-react-app basic and the react app was created. I then went into the basic folder and tried npm start
but it gave me the following error:
npm start [email protected] start C:\Users\91982\Desktop\html&css\React\basic react-scripts start 'css\React\basic\node_modules\.bin\' is not recognized as an internal or external mand, operable program or batch file. internal/modules/cjs/loader.js:985 throw err; ^ Error: Cannot find module 'C:\Users\91982\Desktop\react-scripts\bin\react-scripts.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15) at Function.Module._load (internal/modules/cjs/loader.js:864: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! [email protected] start: `react-scripts start` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A plete log of this run can be found in: npm ERR! C:\Users\91982\AppData\Roaming\npm-cache\_logs\2020-06-10T19_54_37_385Z-debug.log
I even tried creating the app with npm but it gave me the same error. The start
script is present in the json file. npm is updated to the latest version.
i used npx create-react-app basic and the react app was created. I then went into the basic folder and tried npm start
but it gave me the following error:
npm start [email protected] start C:\Users\91982\Desktop\html&css\React\basic react-scripts start 'css\React\basic\node_modules\.bin\' is not recognized as an internal or external mand, operable program or batch file. internal/modules/cjs/loader.js:985 throw err; ^ Error: Cannot find module 'C:\Users\91982\Desktop\react-scripts\bin\react-scripts.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15) at Function.Module._load (internal/modules/cjs/loader.js:864: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! [email protected] start: `react-scripts start` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A plete log of this run can be found in: npm ERR! C:\Users\91982\AppData\Roaming\npm-cache\_logs\2020-06-10T19_54_37_385Z-debug.log
I even tried creating the app with npm but it gave me the same error. The start
script is present in the json file. npm is updated to the latest version.
- First delete the node modules folder and then again install it. – Kundan Commented Jun 11, 2020 at 13:14
6 Answers
Reset to default 3try this
Goto > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart your System.
after restarting it will work 100%..
thanks
You can try the following:
- cd to your project directory (Make sure there is a package.json file)
- delete node_modules directory
- npm install && npm start
- npm install create-react-app -g
- cd you project folder
- delete node_modules folder
- npm install && npm start
It appears you didn't install the dependencies. Run npm i
or npm install
to install the dependencies. It's not finding the react-scripts module because it wasn't installed.
I think it is an issue with your Windows PATH environment variable. It is trying to execute something in the local project node_modules directory, but windows cant find it because it is not in the path.
You can try using the npx
mand instead of npm
.
npx start
Npx checks the PATH and local project binaries for executable.
I solved the issue. I had to add C:/Windows/Systen32 to my system variables Path. It started working after that.
本文标签: javascriptnpm start command giving error in react appStack Overflow
版权声明:本文标题:javascript - npm start command giving error in react app - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742030223a2416305.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论