Install failed - npm expo/ngrok error?


#1

I’m trying to install expo for the first time and am working through the instructions from https://docs.expo.io/versions/latest/introduction/installation.html. At the end of https://docs.expo.io/versions/latest/guides/genymotion.html, I’m doing:

sudo npm install -g exp

and I get a fatal error. The key line seems to be:

ngrok - error unpacking binary { Error: EACCES: permission denied, open '/usr/local/lib/node_modules/exp/node_modules/@expo/ngrok/bin/ngrok'

The rest of this message is the tail of the log:

14088 silly postinstall request@2.83.0
14089 info lifecycle request@2.83.0~postinstall: request@2.83.0
14090 silly postinstall @expo/ngrok@2.3.0
14091 info lifecycle @expo/ngrok@2.3.0~postinstall: @expo/ngrok@2.3.0
14092 verbose lifecycle @expo/ngrok@2.3.0~postinstall: unsafe-perm in lifecycle false
14093 verbose lifecycle @expo/ngrok@2.3.0~postinstall: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/lib/node_modules/exp/node_modules/@expo/ngrok/node_modules/.bin:/usr/local/lib/node_modules/exp/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
14094 verbose lifecycle @expo/ngrok@2.3.0~postinstall: CWD: /usr/local/lib/node_modules/exp/node_modules/@expo/ngrok
14095 silly lifecycle @expo/ngrok@2.3.0~postinstall: Args: [ ‘-c’, ‘node ./postinstall.js’ ]
14096 silly lifecycle @expo/ngrok@2.3.0~postinstall: Returned: code: 1 signal: null
14097 info lifecycle @expo/ngrok@2.3.0~postinstall: Failed to exec postinstall script
14098 verbose unlock done using /home/deg/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
14099 warn optional SKIPPING OPTIONAL DEPENDENCY: @expo/traveling-fastlane-darwin@1.2.5 (node_modules/exp/node_modules/@expo/traveling-fastlane-darwin):
14100 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/traveling-fastlane-darwin@1.2.5: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
14101 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
14101 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
14101 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux
14101 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
14102 verbose stack Error: @expo/ngrok@2.3.0 postinstall: node ./postinstall.js
14102 verbose stack Exit status 1
14102 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
14102 verbose stack at emitTwo (events.js:126:13)
14102 verbose stack at EventEmitter.emit (events.js:214:7)
14102 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
14102 verbose stack at emitTwo (events.js:126:13)
14102 verbose stack at ChildProcess.emit (events.js:214:7)
14102 verbose stack at maybeClose (internal/child_process.js:925:16)
14102 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14103 verbose pkgid @expo/ngrok@2.3.0
14104 verbose cwd /home/deg/.local/share
14105 verbose Linux 4.4.0-109-generic
14106 verbose argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” "exp"
14107 verbose node v8.9.4
14108 verbose npm v5.6.0
14109 error code ELIFECYCLE
14110 error errno 1
14111 error @expo/ngrok@2.3.0 postinstall: node ./postinstall.js
14111 error Exit status 1
14112 error Failed at the @expo/ngrok@2.3.0 postinstall script.
14112 error This is probably not a problem with npm. There is likely additional logging output above.
14113 verbose exit [ 1, true ]


#2

I forgot to mention: this is under Ubuntu 16.04


#3

hey @degeldeg

You can follow this guide: https://docs.npmjs.com/getting-started/fixing-npm-permissions

But to be more productive now, you could install a local copy of exp in your project, like for devDependencies in your package.json. Then like in scripts, exp start, and it will use the one in node_modules/.bin


#4

Thanks! That guide got me past the problem.


closed #5

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