epicweb-dev / react-fundamentals

Material for my React Fundamentals Workshop
https://fundamentals.epicreact.dev
Other
5.3k stars 3.21k forks source link

npm run setup problems #377

Closed TrickkyRicky closed 2 months ago

TrickkyRicky commented 2 months ago

Node version: v20.15.0 npm version: 10.8.3 npx version: 10.2.2 (This also references the versions above)

I've successfully cloned the project and I've ran npm run setup but I do not receive a success message that the setup.js file intends to give. I've consoled log the output of result and the below output is what I've received

> setup
> node ./epicshop/setup.js

▶️  Starting workshop setup...
      Running the following command: npx --yes "https://gist.github.com/kentcdodds/bb452ffe53a5caa3600197e1d8005733" -q
{
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 87317,
  stdout: null,
  stderr: null
}

Has anyone had this problem occur? I've also used nvm to change my versions to reference node 21.0.0 but I still receive the same output

kentcdodds commented 2 months ago

Hmmm... This is unusual. Normally you should get more useful output. Try running this:

npx --yes "https://gist.github.com/kentcdodds/bb452ffe53a5caa3600197e1d8005733" -q

Does that have output for you?

TrickkyRicky commented 2 months ago

Hmmm... This is unusual. Normally you should get more useful output. Try running this:

npx --yes "https://gist.github.com/kentcdodds/bb452ffe53a5caa3600197e1d8005733" -q

Does that have output for you?

@kentcdodds This didn't output anything for me. I did run

npx node -v

and this returned to me version 16.20.2, but my node version is 20.15.0

kentcdodds commented 2 months ago

Ah, that mismatch could be an issue. Try

npm install -g npx
TrickkyRicky commented 2 months ago

Ah, that mismatch could be an issue. Try

npm install -g npx

I deleted the old npx references and I npm installed the latest version which fixed the versioning issue, but I am still getting the same exact output from the beginning of the thread.

kentcdodds commented 2 months ago

Could you try running this one and tell me the output?

npx --yes "https://gist.github.com/kentcdodds/abbc32701f78fa70298d444c2303b6d9"
TrickkyRicky commented 2 months ago

Could you try running this one and tell me the output?

npx --yes "https://gist.github.com/kentcdodds/abbc32701f78fa70298d444c2303b6d9"

Without the -q at the end of the command. My terminal brings up the npx --help menu highlighted in red, and with the quiet flag applied the same output is given just like the previous gist

kentcdodds commented 2 months ago

This script is what's being run and failing: https://gist.github.com/kentcdodds/abbc32701f78fa70298d444c2303b6d9

Could you verify the version of npm, node, and git you have installed?

TrickkyRicky commented 2 months ago

This script is what's being run and failing: https://gist.github.com/kentcdodds/abbc32701f78fa70298d444c2303b6d9

Could you verify the version of npm, node, and git you have installed?

Here are the versions image

kentcdodds commented 2 months ago

Huh, that's really odd.

Well, I'm not sure why the setup isn't working, but the workaround is simply to run: npm install. That should work just fine since you've already verified you have the right version of things.

Sorry for the trouble!

TrickkyRicky commented 2 months ago

I was able to solve this by deleting my global npm package and using nvm to reinstall it. Turns out that my global npm was referencing node version 16.20.2 even though my node version was 20.15.0

kentcdodds commented 2 months ago

Excellent! I'm glad you worked it out!