Using expo to work on my react native projects using expo start always worked before. Now it doesn't work, so I reinstalled node.js. I installed expo using npm install -g expo-cli but expo start gave me:

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

I checked my error file and this is what it says:

0 info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'start' ] 2 info using npm@6.4.1 3 info using node@v10.14.2 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle @~prestart: @ 6 info lifecycle @~start: @ 7 verbose lifecycle @~start: unsafe-perm in lifecycle true 8 verbose lifecycle @~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Linda\Documents\U of T Engineering\2018\Jobs\IoT for Education\alarmApp\node_modules\.bin;C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Boxstarter;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\TDM-GCC-64\bin;C:\Program Files\Git\cmd;C:\Python3;C:\Python3\Scripts;C:\Program Files\PuTTY\;C:\Program Files\MATLAB\R2017b\bin;C:\Go\bin;C:\WINDOWS\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\xampp\php;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs\;C:\Users\Linda\AppData\Local\Programs\Python\Python36-32\Scripts\;C:\Users\Linda\AppData\Local\Programs\Python\Python36-32\;C:\Users\Linda\AppData\Local\Microsoft\WindowsApps;C:\Users\Linda\AppData\Local\atom\bin;C:\altera_lite\16.0\modelsim_ase\win32aloem;C:\Users\Linda\AppData\Local\Microsoft\WindowsApps;C:\Users\Linda\go\bin;C:\Program Files\Docker Toolbox;;C:\Program Files\Docker Toolbox;C:\Program Files\Docker Toolbox;C:\Users\Linda\AppData\Roaming\Composer\vendor\bin;C:\Users\Linda\AppData\Roaming\npm 9 verbose lifecycle @~start: CWD: C:\Users\Linda\Documents\U of T Engineering\2018\Jobs\IoT for Education\alarmApp 10 silly lifecycle @~start: Args: [ '/d /s /c', 'expo start' ] 11 silly lifecycle @~start: Returned: code: 1 signal: null 12 info lifecycle @~start: Failed to exec start script 13 verbose stack Error: @ start: `expo start` 13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16) 13 verbose stack at EventEmitter.emit (events.js:182:13) 13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:182:13) 13 verbose stack at maybeClose (internal/child_process.js:962:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) 14 verbose pkgid @ 15 verbose cwd C:\Users\Linda\Documents\U of T Engineering\2018\Jobs\IoT for Education\alarmApp 16 verbose Windows_NT 10.0.17134 17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" 18 verbose node v10.14.2 19 verbose npm v6.4.1 20 error code ELIFECYCLE 21 error errno 1 22 error @ start: `expo start` 22 error Exit status 1 23 error Failed at the @ start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ] 

I have no idea why expo stopped working and what the error file means. Please help! Thanks.

5 Answers

I fixed it! I don't know why this works but:

npm i expo-cli then run npm start.

First check if /users/[you]/.npm-global/bin is in your path.

echo $PATH If it isn’t there, you will need to add it to the path.

in a shell type:

export PATH=$PATH:~/.npm-global/bin source ~/.bash_profile

if you run > expo

in the shell now, the command should be recognized...

Use the vscode terminal, after clearing cache

Try these commands, I have fixed the issue. Try it

expo r -c 

For some reason, the update messed with the path. So I had to go to edit environment variables and add another line to the variable "Path" under the system variables.

Don't hit new. Click on "Path" under the system variables section and add a new line there. Use "%USERPROFILE%\AppData\Roaming\npm".

Then open a new command line and it should work.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy