I can’t install “npx create react” but when i try npm instead npx I found the file i tried to install but i can’t make “npm start”
For the first one, is create-react-app installed globally?
For the second one, did you do an npm install
after moving into that folder? And do an ls
so we can see what is in it.
I had installed it globally but when using npx I have this Error.
Now I installed npm but I have another error. but I don’t know why it using MongoDB bath?.
I think you need to figure out where CRA installed and make sure that that is in your $PATH.
What version of node do you have?
Check with node --version
. If it’s less than 5.2 it’s very old and you don’t have the npx
script available. Upgrade Node.
The point of npx
is that you don’t ever need to install scripts globally (which is generally not a great idea, npx removes the need to do that).
If this is the issue, uninstall CRA globally, upgrade Node, run npx create-react-app my-app-name
I have the last version of node & npm
Well, it’s a few years old but it should have npx. What does it say when you run npx -v
the same npm version
What happens if you run npx cowsay hello
? Do you get a picture of a cow saying hello
npx cowsay hello
spawn C:\MongoDB\Server\4.2\data ENOENT
That is the result I got.
I don’t no why the result has this path?
Although I added another path into environment.
Ah, something is pretty messed up here because there should be no reason whatsoever that this should be trying to run MongoDB. Googling brings up several people have the exact same issue over the past year or so: all with MongoDB, exact same error.
Run npm cache clean --force
and see if it works after that
Bug is with npx specifically I think, it just shouldn’t happen but MongoDB seems to trigger this issue. It is to do with paths and Windows – I’m not going to be a lot of help on this from here if the cache clean doesn’t work as I don’t use Windows & I can’t replicate to try to get the error
Now I have wsl2 ubuntu 20.04 . Do have I install node.js again?
Type node -v
and it will show the current version if it is installed.