Search code examples
node.jsreactjsnpmcreate-react-appnpm-cli

Unable to install npx create-react-app@3.3.0 nucampsite


As instructed by my school, I was trying to install "npx create-react-app@3.3.0 nucampsite" but it opens up visual studio code with the file npm-cli.js

I tried running the command from Visual Studio Code and I got this error message:

C:\Users\Jay\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js:1
npm/usr/bin/nodejs
^

ReferenceError: npm is not defined
   at Object.<anonymous> (C:\Users\Jay\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js:1:1)
   at Module._compile (internal/modules/cjs/loader.js:1138:30)
   at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
   at Module.load (internal/modules/cjs/loader.js:986:32)
   at Function.Module._load (internal/modules/cjs/loader.js:879:14)
   at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
   at internal/main/run_main_module.js:17:47

On line 1 on Visual Studio Code this is what I have:

npm/usr/bin/nodejs 

Solution

  • Fixed! I uninstalled node and npm and then reinstalled it back and it seemed to work perfectly! thank you guys!