create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

problem running npm start

Open NurMohammadakram opened this issue 3 years ago • 9 comments

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

NurMohammadakram avatar Jan 29 '22 12:01 NurMohammadakram

Delete node_modules and package-lock.json, then run npm install again.

saurabhan avatar Jan 29 '22 12:01 saurabhan

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" ] } }

NurMohammadakram avatar Jan 29 '22 13:01 NurMohammadakram

Delete node_modules and package-lock.json, then run npm install again.

please check my comment

NurMohammadakram avatar Jan 29 '22 13:01 NurMohammadakram

Run this command npm install react-scripts and then try to run the npm start

saurabhan avatar Jan 29 '22 13:01 saurabhan

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.

ananta-dev avatar Feb 02 '22 06:02 ananta-dev

Absolutely same as @freenrg for my problem solution, if You have & in your root folder change it to something ( and is meaningful)

BishalPoudel149 avatar Mar 13 '22 06:03 BishalPoudel149

all of that answers don`t work

KhaledKhlefAlabdullah avatar Aug 26 '23 08:08 KhaledKhlefAlabdullah

If your project path contains special characters like &, ^, and *, it might cause issues in certain cases.

KhaledKhlefAlabdullah avatar Aug 28 '23 09:08 KhaledKhlefAlabdullah

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.

sharjeelfaiq avatar Jan 08 '24 20:01 sharjeelfaiq