I have been working with react for almost 1 year. I didn't have this problem but since I re-installed my OS, I cant use commands like : 'npx create-react-app my-app' and it get this result :
'"node"' is not recognized as an internal or external command,
operable program or batch file.
I have
- installed nodejs and added it's path to environment variables.
- restarted VSCode.
- restarted the system.
- uninstalled everything including files in Roaming directory.
- changed the installation directory for nodejs and updated it's path
- cleared node cache
but nothing works.
When I type in 'node -v' or 'npm -v' i get the version back. so they are recognized in the system. and also when I use yarn, this happens :
yarn create react-app client
yarn create v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-react-app@4.0.3" with binaries:
- create-react-app
Creating a new React app in D:\Projects\DEVCONNECTOR\client.
'npm' is not recognized as an internal or external command,
operable program or batch file.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
'npm' is not recognized as an internal or external command,
operable program or batch file.
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts@0.9.x has failed.
Deleting generated file... package.json
Deleting client/ from D:\Projects\DEVCONNECTOR
Done.
error Command failed.
Exit code: 1
Command: C:\Users\damon\AppData\Local\Yarn\bin\create-react-app
Arguments: client
Directory: D:\Projects\DEVCONNECTOR
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
So it first begins to install the package but then I get the same error and the package gets deleted. although I can use yarn in other commands like starting the server etc.
Thanks in advance