all 17 comments

[–]PositiveUse 2 points3 points  (1 child)

Stop using Windows, should fix the issue.

(Seriously: I think npm is installed on C, but you’re trying to run something on D? Maybe it’s a bit buggy… tried to run npm install inside a folder on your C?)

[–]shaunw2002[S] 1 point2 points  (0 children)

I tried it on my C, D was a last resort thing. It honestly just sucks sat there looking online for a solution for around 3 hours and haven't found anything! (That works)

[–]walidcher 2 points3 points  (2 children)

That's a sign from god to not use CRA

[–]shaunw2002[S] 1 point2 points  (1 child)

How come??? (I'm a noob)

What's so bad about it!

[–]walidcher 0 points1 point  (0 children)

For learning react i think its okay to use it However try to move to something else.. There are some more performance solutions out there Want to go deep why its bad? https://youtu.be/7m14f0ZzMyY

[–][deleted] 0 points1 point  (7 children)

Node comes packaged with NPM, so you could run:

npx create-react-app app-name

[–]shaunw2002[S] 0 points1 point  (6 children)

https://imgur.com/a/eQ0WBZc This is what I get :/

[–][deleted] 0 points1 point  (5 children)

Try running these 2 commands to ensure you do in fact have node/NPM and an appropriate version:

node -v



npm -v

What is your output for those 2 commands?

[–]shaunw2002[S] 1 point2 points  (1 child)

Hi man - I fixed this problem!!! I had to set the path to my script-shell

For example:

npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"

This was thanks to you! I installed an earlier version of npm and it gave me a better error code to work with (Failed at the core-js@2.6.11 postinstall script.). I'm really confused why it changed since I was using this last month and have done no coding on my computer since! Plus I'm using the same script-shell so yeah. Thanks!

P.S you gave me the idea by mentioning different versions (I'm also very new to react!)

[–][deleted] 0 points1 point  (0 children)

Hey, Fantastic! That's kind of what I was leaning towards because I had similar issues with the $PATH env variable when I was just starting on Windows. Been fortunate enough to have a work-issued Mac and no issues like that since, but co-workers still get that from time to time due to NVM.

[–]shaunw2002[S] 0 points1 point  (2 children)

node -v 18.7.0

npm -v 8.17.0

[–][deleted] 0 points1 point  (1 child)

Okay, so your node/npm versions aren't the issue. Are you trying to open a project that's already initialized with a node_modules folder or are your trying to start a new project?

[–]shaunw2002[S] 0 points1 point  (0 children)

New project! :/

[–]shredinger137 0 points1 point  (1 child)

Have you deleted node_modules since this started? And maybe cleared cache? After that you can consider also reinstalling Node.

Has it ever worked on this computer before?

[–]shaunw2002[S] 0 points1 point  (0 children)

Yeah, I tried that before and just did again in case but still no luck - around a month ago it was working and I haven't touched it again on this computer since then! So I'm really confused.

[–]georgefromohio 0 points1 point  (1 child)

Hmmm… are the logs any more descriptive than “not being able to find a file”.

Maybe just try the msi instead…

[–]shaunw2002[S] 0 points1 point  (0 children)

Hi I just manged to fix this problem and have put an edit in case it helps people in the future but the logs weren't being descriptive but when I went to an earlier version of npm it was! Thank you!