0
votes

when I'm trying to use npx create-react-app MernCrud it not working properly I try to change the prefix path of npm config but its giving the same error and path doesn't change

I tried to install npm then this came

C:\Users\Pumudu Fernando\Desktop\ReactProject>npm install npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\Pumudu Fernando\Desktop\ReactProject\package.json' npm notice created a lockfile as package-lock.json. You should commit this file.

npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Pumudu Fernando\Desktop\ReactProject\package.json' npm WARN ReactProject No description npm WARN ReactProject No repository field. npm WARN ReactProject No README data npm WARN ReactProject No license field.

when try to npx create-react-app MernCrud

C:\Users\Pumudu Fernando\Desktop\ReactProject>nox create-react-app CrudMern 'nox' is not recognized as an internal or external command, operable program or batch file.

C:\Users\Pumudu Fernando\Desktop\ReactProject>npx create-react-app CrudMern Error: EPERM: operation not permitted, mkdir 'C:\Users\Pumudu' TypeError: Cannot read property 'get' of undefined at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7 at Array.forEach () at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20) at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53 C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205 if (npm.config.get('json')) { ^

TypeError: Cannot read property 'get' of undefined at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18) at process.emit (events.js:189:13) at process._fatalException (internal/bootstrap/node.js:496:27) Install for create-react-app@latest failed with code 7

It should create the project but that won't happen npm start also not working

1

1 Answers

0
votes

Finally i found the answer so i clear the cache npm cache clean --force then i change the prefix path of config edit to C:\Users\\AppData\Roaming\npm

then i gave the command to administrator cmd npm config set cache C:\tmp\nodejs\npm-cache --global after that npx create-react-app name work properly