Reputation: 429
Why is npm not recognized?
I'm trying to learn react and get started using it. I have node installed, and the package create-react-app.
If I type in my command line, npm -v
or create-react-app -V
, it will return the current versions I have. Which is step one in my problem.
Step two would be checking the environment paths.
I have C:\Users\hunte\AppData\Roaming\npm
in my paths and I even ran my bash command line as administrator with no such luck.
Step three I assume would be restarting my computer. (Obviously it didn't work)
How I installed and tried to step up react is like this...
npm install -g create-react-app
create-react-app my-app
Then it returns 'npm' is not recognized as an internal or external command.
I'm lost, looking for some help to resolve this as I really eager to learn react.js.
Thank's to all who spend the time reading my question.
Here's my cmd
$ create-react-app test
Creating a new React app in C:\Users\hunte\desktop\test\test.
'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 [email protected] has failed.
Deleting generated file... package.json
Deleting test/ from C:\Users\hunte\desktop\test
Done.
Upvotes: 2
Views: 3241
Reputation: 17
Using the default Command Prompt worked for me. I was previously working on Hyper.
Upvotes: 0
Reputation: 429
I've figured it out!
For everyone who runs into a similar problem all I did to get it to work was change CMDs.
I was using the Git Bash CMD as I like it better; however, I guess it doesn't work well with the system paths/environments.
All I did to fix this issue to run my default cmd as administrator and tried again. This time it worked and I was successful in creating the react package.
Upvotes: 6