Expo CLI starts succcessfully only the first time, fails after that

Output of diagnostics:

 Expo CLI 3.16.1 environment info:
    System:
      OS: Windows 10 10.0.17763
    Binaries:
      Node: 12.9.1 - C:\Program Files\nodejs\node.EXE
      npm: 6.14.3 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: Version  3.6.0.0 AI-192.7142.36.36.6241897
    npmPackages:
      expo: ~36.0.0 => 36.0.2
      react: ~16.9.0 => 16.9.0
      react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4

I was using expo-cli normally for a while with the latest version of node and expo-cli.
Until recently, everytime I npm start the project, expo fails to start:

And the log:

1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\ASUS\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start'
1 verbose cli ]
2 info using npm@6.14.3
3 info using node@v12.9.1
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:\Users\ASUS\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\Books\EdX-REact Course\Lec5 - Lists, User Input\contactapp\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;%JAVA%\bin;D:\Tomcat\apache-tomcat-7.0.96\bin;C:\Program Files\Git\cmd;D:\elasticsearch-7.3.2-windows-x86_64\elasticsearch-7.3.2\bin;C:\Program Files\dotnet\;D:\Code\lib;C:\Program Files\nodejs\;C:\Users\ASUS\AppData\Local\Programs\Python\Python37-32\Scripts\;C:\Users\ASUS\AppData\Local\Programs\Python\Python37-32\;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\ASUS\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\ASUS\AppData\Roaming\npm
9 verbose lifecycle @~start: CWD: D:\Books\EdX-REact Course\Lec5 - Lists, User Input\contactapp
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:\Users\ASUS\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:209:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\ASUS\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:209:13)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid @
15 verbose cwd D:\Books\EdX-REact Course\Lec5 - Lists, User Input\contactapp
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ASUS\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.9.1
19 verbose npm  v6.14.3
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 tried to re-install node and expo-cli using node version:
12.16.1 --> still fails at the first start
12.10.0 --> still fails at the first start
12.9.0 --> it starts successfully on the first time but if I stop expo-cli and run again it fails

I even tried on WSL as suggested here but still the same error.

Could anybody have the same problem please help?

Hi. Although this should not be a problem, what happens if you rename your “EdX-REact Course\Lec5 - Lists, User Input” directories to remove the spaces and comma?

What stands out to me is this:

error Cannot find module 'D:\Books\EdX-REact Course\Lec5 - Lists'

which looks like it was cut off at the comma for some reason.

Also, what happens if you directly run expo start instead of npm start?

1 Like

@wodin you are such life savior, I have been stuck for my React course for a week because of this.
And yes, remove all the space and special characters in the folder name seems to get expo-cli working as normally.

Perfect, thank you so much. But I was wondering why didn’t this happen to me earlier, it just happened out of nowhere.

1 Like

I’m glad it’s working for you, but I don’t know why it would suddenly have broken.

Maybe you upgraded expo-cli recently and there’s a bug in the latest version or something like that?

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.