create-react-app
create-react-app copied to clipboard
problem running npm start
running npm start throw en error
'library' is not recognized as an internal or external command, operable program or batch file. node:internal/modules/cjs/loader:936 throw err; ^
Error: Cannot find module 'G:\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: []
}
my node version v16.13.0 npm version 8.1.0
Delete node_modules and package-lock.json, then run npm install again.
I tried but the problem remains.
Here is my package.json file you can check what should I do?
{ "name": "react-new-app", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.16.1", "@testing-library/react": "^12.1.2", "@testing-library/user-event": "^13.5.0", "react": "^17.0.2", "react-dom": "^17.0.2", "react-scripts": "5.0.0", "web-vitals": "^2.1.4" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }
Delete node_modules and package-lock.json, then run npm install again.
please check my comment
Run this command npm install react-scripts
and then try to run the npm start
In my case the problem was that the path to the app folder contained a "&". I changed the "&" to "and" and that fixed it.
I had tried the suggestions above, but they had not worked.
Absolutely same as @freenrg for my problem solution, if You have & in your root folder change it to something ( and is meaningful)
all of that answers don`t work
If your project path contains special characters like &, ^, and *, it might cause issues in certain cases.
In my case, I resolved it by making all the characters lowercase and using hyphen (-) instead of adding spaces to separate words in the name of the folder containing project files. The same applies to the parent folders. If any of the parent folders have spaces, special symbols, and uppercase letters (which might cause errors), then use lowercase letters and hyphens (-) instead.
For example: Replace Folder Name: React App & Website With Folder Name: react-app-and-website
I hope this may prove to be helpful.