Error is thrown on Debug in Expo's first fun, failing when trying to install dependencies
Dependencies install successfully and debugging begins
Debug Console
Launching the application
VSCode Output Tab
[Info] Making sure your project uses the correct dependencies for Expo. This may take a while...
Checking if this is Expo app......
....[Error] Error: Error while executing command 'npm install @expo/xdl @expo/ngrok --verbose --no-save' (error code 101)
Developer Tools console
console.ts:137 [Extension Host] (node:31525) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ console.ts:70
console.ts:137 [Extension Host] rejected promise not handled within 1 second: Error: Error while executing command 'npm install @expo/xdl @expo/ngrok --verbose --no-save' (error code 101)
t.log @ console.ts:70
console.ts:137 [Extension Host] stack trace: Error: Error while executing command 'npm install @expo/xdl @expo/ngrok --verbose --no-save' (error code 101) at Function.getInternalError (/Users/gabrielbarriga/.vscode/extensions/msjsdiag.vscode-react-native-1.1.0/dist/rn-extension.js:1:6947) at ChildProcess.<anonymous> (/Users/gabrielbarriga/.vscode/extensions/msjsdiag.vscode-react-native-1.1.0/dist/rn-extension.js:1:51188) at Object.onceWrapper (events.js:313:26) at ChildProcess.emit (events.js:223:5) at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
t.log @ console.ts:70
mainThreadExtensionService.ts:65 [[object Object]]Error while executing command 'npm install @expo/xdl @expo/ngrok --verbose --no-save' (error code 101)
$onExtensionRuntimeError @ terminalInstanceService.ts:31
mainThreadExtensionService.ts:66 Error: Error while executing command 'npm install @expo/xdl @expo/ngrok --verbose --no-save' (error code 101)
at Function.getInternalError (/Users/gabrielbarriga/.vscode/extensions/msjsdiag.vscode-react-native-1.1.0/dist/rn-extension.js:1)
at ChildProcess.<anonymous> (/Users/gabrielbarriga/.vscode/extensions/msjsdiag.vscode-react-native-1.1.0/dist/rn-extension.js:1)
at Object.onceWrapper (events.js:313)
at ChildProcess.emit (events.js:223)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272)
npx expo doctor:Didn't find any issues with the project!
envinfo: System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Memory: 2.05 GB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.14.0 - ~/.nvm/versions/node/v14.14.0/bin/node
npm: 6.14.8 - ~/.nvm/versions/node/v14.14.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
Homebrew: 2.5.6 - /usr/local/bin/brew
pip3: 20.2.3 - /usr/local/bin/pip3
RubyGems: 3.0.3 - /usr/bin/gem
Utilities:
Make: 3.81 - /usr/bin/make
GCC: 4.2.1 - /usr/bin/gcc
Git: 2.29.1 - /usr/local/bin/git
Clang: 1200.0.32.21 - /usr/bin/clang
Servers:
Apache: 2.4.41 - /usr/sbin/apachectl
SDKs:
iOS SDK:
Platforms: iOS 14.1, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
Android SDK:
API Levels: 23, 24, 25
Build Tools: 23.0.1, 25.0.2
System Images: a...-23 | Intel x86 Atom, a...-24 | Intel x86 Atom, a...google_apis | Google APIs Intel x86 Atom Sys...
IDEs:
Atom: 1.12.7
Nano: 2.0.6 - /usr/bin/nano
Sublime Text: Build 3211
VSCode: 1.50.1 - /usr/local/bin/code
Vim: 8.1 - /usr/bin/vim
Xcode: 12.1/12A7403 - /usr/bin/xcodebuild
Languages:
Bash: 3.2.57 - /bin/bash
Java: 1.8.0_121 - /usr/bin/javac
Perl: 5.18.4 - /usr/bin/perl
PHP: 7.3.11 - /usr/bin/php
Python: 2.7.16 - /usr/bin/python
Python3: 3.8.6 - /usr/local/bin/python3
Ruby: 2.6.3 - /usr/bin/ruby
Databases:
MySQL: 10.5.6 (MariaDB) - /usr/local/bin/mysql
SQLite: 3.28.0 - /usr/bin/sqlite3
Browsers:
Chrome: 86.0.4240.111
Firefox: 80.0
Safari: 14.0
When searching for a solution for this problem I came upon this old issue and then tried changing my node version using nvm. I run into the same problem using an older version (v12.19.0) and when using the latest version of node (v15.0.1). Just to note: the latest version does print this warning when using npx expo doctor:
npx expo doctor on node 15.0.1
WARNING: expo-cli has not yet been tested against Node.js v15.0.1.
If you encounter any issues, please report them to https://github.com/expo/expo-cli/issues
expo-cli supports following Node.js versions:
* >=10.13.0 <11.0.0 (Maintenance LTS)
* >=12.13.0 <13.0.0 (Active LTS)
* >=14.0.0 <15.0.0 (Current Release)
I'm pretty lost here and not sure what to do. Anyone have any idea what I'm doing wrong here?
Hi @Gabemb and thanks for reaching us.
Could you please send us the value of process.env.PATH from VS Code:
Help -> Toggle Developer Tools)process.env.PATH and copy the output hereThe Node path should be in this PATH variable, otherwise this might be the reason of the problem.
Could you please also tell us which version of Node.js is set as default in nvm and check if your .zshrc file contains this:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
Hi, @RedMickey! Thanks for helping out! Once I checked the value for that variable in VS Code's developer console, I saw that it was using the node v15.0.1 bin instead of the v14.14.0 I had set as my default in nvm.
VS Code's process.env.PATH
"/Users/gabrielbarriga/.nvm/versions/node/v15.0.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin"
nvm list
-> v14.14.0
v15.0.1
system
14 -> v14.14.0
default -> 14 (-> v14.14.0)
node -> stable (-> v15.0.1) (default)
stable -> 15.0 (-> v15.0.1) (default)
iojs -> N/A (default)
unstable -> N/A (default)
lts/* -> lts/erbium (-> v12.19.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0
lts/dubnium -> v10.22.1 (-> N/A)
lts/erbium -> v12.19.0
It seems like simply changing the default alias isn't enough, so I had to force the change by uninstalling v15.0.1. Once I did, everything began working as expected 馃帀
nvm list after uninstalling 15
-> v14.14.0
system
14 -> v14.14.0
default -> 14 (-> v14.14.0)
node -> stable (-> v14.14.0) (default)
stable -> 14.14 (-> v14.14.0) (default)
iojs -> N/A (default)
unstable -> N/A (default)
lts/* -> lts/erbium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.22.1 (-> N/A)
lts/erbium -> v12.19.0 (-> N/A)
Thanks again for the help!
@Gabemb, I'm glad to hear that it works! Do you need any more help from our side or I can close the issue?
@RedMickey That's all! Thanks again and feel free to close this issue whenever!
Most helpful comment
@RedMickey That's all! Thanks again and feel free to close this issue whenever!