0

I'm trying to install expo cli using npm install -g expo-cli after uninstalling it but I'm getting the following error:

> @expo/traveling-fastlane-linux@1.15.1 preinstall C:\Users\owl\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\traveling-fastlane-linux
> node platform.js

'node' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\owl\AppData\Roaming\npm\expo -> C:\Users\owl\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js
C:\Users\owl\AppData\Roaming\npm\expo-cli -> C:\Users\owl\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js

> core-js@2.6.11 postinstall C:\Users\owl\AppData\Roaming\npm\node_modules\expo-cli\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

'node' is not recognized as an internal or external command,
operable program or batch file.

....

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! core-js@2.6.11 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the core-js@2.6.11 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\owl\AppData\Roaming\npm-cache\_logs\2020-07-03T09_59_16_882Z-debug.log


I used to have no issues installing npm packages, I don't know if I accidentally deleted some files

  • the nodejs has already been added to the path in the environment variables
  • I've tried re-installing npm and nodejs, clearing npm cache, restarting but nothing seems to be working :(
$ npm --version
6.14.5 
$ node --version
v12.18.2

Any suggestions?
Thank you

Update: Starting the terminal as an admin and running the command again solved the problem :)

owl
  • 1
  • 1
  • I don't know much about windows OS but I'm sure that you need to set the variable path by doing some stuff in the advanced system setting of your control panel. check out this link https://love2dev.com/blog/node-is-not-recognized-as-an-internal-or-external-command/#:~:text=Make%20sure%20the%20node%20path,directly%20on%20the%20command%20line. – CodeBug Jul 03 '20 at 10:34
  • Does this answer your question? ['node' is not recognized as an internal or an external command, operable program or batch file while using phonegap/cordova](https://stackoverflow.com/questions/23412938/node-is-not-recognized-as-an-internal-or-an-external-command-operable-program) – Andrew Myers Jul 03 '20 at 19:44

1 Answers1

0

For anyone who could be facing a similar problem, try running the command while using the terminal as an admin

owl
  • 1
  • 1