inconshreveable / ngrok

Unified ingress for developers
https://ngrok.com
Other
24.12k stars 4.26k forks source link

npm installation fails #429

Closed bserem closed 3 months ago

bserem commented 7 years ago

As of today I can't install ngrok via npm, I get the following output on Debian with node 5.0.4:

sudo npm install ngrok -g
/usr/local/bin/ngrok -> /usr/local/lib/node_modules/ngrok/bin/ngrok

> ngrok@2.2.11 postinstall /usr/local/lib/node_modules/ngrok
> node ./postinstall.js

ngrok - downloading binary https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip ...
ngrok - error downloading binary. { Error: EACCES: permission denied, open '/usr/local/lib/node_modules/ngrok/bin/ngrok.zip'
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/usr/local/lib/node_modules/ngrok/bin/ngrok.zip' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngrok@2.2.11 postinstall: `node ./postinstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ngrok@2.2.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!     /root/.npm/_logs/2017-06-28T11_13_44_043Z-debug.log

Installation was working fine 10 days ago.

This also breaks the installation of https://github.com/expo/exp

shroudedcode commented 7 years ago

@bserem Same here, I used this installation method on my last machine a few months ago, but after reinstalling it yesterday it doesn't work anymore. I get the same error message.

rubensbarreto commented 7 years ago

Same issue here on Mac OS Sierra, npm 5.3.0

rubensbarreto commented 7 years ago

Managed to install it by using yarn instead of npm In my case I was installing ngrok with exp, so I used yarn global add exp

sachinharpalani commented 6 years ago

I was having the same issue with npm install -g exp. I also tried with yarn global add exp and it didnt work. What worked was installing ngrok through yarn "yarn global add ngrok" and then "yarn global add exp" and it worked

sanchil commented 6 years ago

for node installs on linux mint and ubuntu where it gets installed in /usr/bin/node and /usr/lib/node_modules, this did the trick for me:

$sudo yarn global add ngork --modules-folder /usr/lib/node_modules $sudo yarn global add exp --modules-folder /usr/lib/node_modules

bcollazo commented 6 years ago

^^ Small typo on ngork (we want ngrok). It worked for me too! (Ubuntu)

AllanDaemon commented 6 years ago

Same problem here. Using Arch linux.

cskonopka commented 6 years ago

This is didn't work for me on a generic EC2 Linux AMI but I have it working on another EC2 Linux AMI where it works perfectly. Both instances are setup the same way but for some reason this one will not let me setup ngrok. I get the same exact error that started this thread. I've tired as root several times and rebooted, no idea whats up. Same versions between each instance.

gabe2code commented 6 years ago

The same for my on Windows 10, I test with npm and yarn, download fine the package and never end of unpack . Any Idea of what happen??

lvicentesanchez commented 6 years ago

Same issue here... I was hoping this has been fixed already.

LongBeachHXC commented 6 years ago

Yeah I'm experiencing this on a brand new Ubuntu build within an ESXI environment.

bitbadger-io commented 6 years ago

Same here, brand new Ubuntu build Xenial under virtualbox

LongBeachHXC commented 6 years ago

Yeah, so I downloaded ngrok directly from the source on my Ubuntu machine using wget and unzipped and placed within the usr/local/ folder and it works like a charm now.

Forrest whatever reason downloading via package manager ngrok fails.

pjm4 commented 6 years ago

I removed sudo from the beginning of the command and it installed with npm (was failing with sudo)! BTW, I was installing "sudo npm install exp --global" when I saw the above error mentioned above.

ankibalyan commented 6 years ago

sudo chown -R $(whoami) /usr/{lib/node_modules} should work.

breart commented 6 years ago

@ankibalyan doesn't work on MacOS High Sierra

breart commented 6 years ago

This one did the trick for me:

sudo npm i -g ngrok --unsafe-perm=true --allow-root
LongBeachHXC commented 6 years ago

brezzhnev...that also worked for me.

brownbl1 commented 6 years ago

@brezzhnev This is the answer. But why is this now necessary and can it be fixed?

breart commented 6 years ago

@brownbl1 just grabbed from here: https://github.com/appium/appium/issues/10293#issuecomment-370334351

Actually, have no idea, would like to ask this question to devs as well :)

For me, npm is like a black box, you never know what could happen whenever you try to install or update dependencies.

GameBitToken commented 5 years ago

sudo npm i -g ngrok --unsafe-perm=true --allow-root

livesafer!

bserem commented 5 years ago

I just saw one line with sudo, unsafe and allow-root... This is what nightmares are made of

super-kamil commented 5 years ago

Same problem on Windows 10. Will this be fixed?

npm install ngrok --unsafe-perm=true --save

It only works with unsafe-perm param.

technocrat2050 commented 5 years ago

This one did the trick for me:

sudo npm i -g ngrok --unsafe-perm=true --allow-root

It worked for me... great, thanks

princefishthrower commented 4 years ago

Chiming in here in 2020 - still the same issue of not being able to find module postinstall.js

I'm on a Ubuntu 16.04.6 LTS machine, Node 12.17.0 via NVM

Surely passing sudo, --unsafe-perm=true, and --allow-root cannot be the answer?

EDIT: Just found https://github.com/bubenshchykov/ngrok/issues/115#issuecomment-380927124

It looks like until postinstall.js is removed, Linux and macOS users have to do it this way.

safweb89 commented 2 years ago

if you're on a macbook with an M1 processor and faced this problem again, make sure that u're using at least the 4.2.2 package version of ngrock

good luck

parizat-hridi commented 2 years ago

sudo snap install ngrok worked for me in VS Code on Linux :)

VanitaKate commented 2 years ago

After Using npm i -g ngrok --unsafe-perm=true --allow-root (windows) also I get below error ngrok - downloading progress: npm ERR! ngrok - error downloading from URL RequestError: unable to get local issuer certificate

PeacefulCosmos commented 2 years ago

Virtualbox Ubuntu 18.04 node version 8.16 I can't install the package by npm

ngrok@2.3.0 postinstall /home/ir-admin/projects/work/inreality/dms/dms-client-node/node_modules/ngrok node ./postinstall.js

ngrok - downloading binary https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip ngrok - error downloading binary { Error: certificate has expired at TLSSocket. (_tls_wrap.js:1116:38) at emitNone (events.js:106:13) at TLSSocket.emit (events.js:208:7) at TLSSocket._finishInit (_tls_wrap.js:643:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:473:38) code: 'CERT_HAS_EXPIRED' } ngrok - install failed, retrying ngrok - downloading binary https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip ngrok - error downloading binary { Error: certificate has expired at TLSSocket. (_tls_wrap.js:1116:38) at emitNone (events.js:106:13) at TLSSocket.emit (events.js:208:7) at TLSSocket._finishInit (_tls_wrap.js:643:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:473:38) code: 'CERT_HAS_EXPIRED' } ngrok - install failed, retrying ngrok - downloading binary https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip ngrok - error downloading binary { Error: certificate has expired at TLSSocket. (_tls_wrap.js:1116:38) at emitNone (events.js:106:13) at TLSSocket.emit (events.js:208:7) at TLSSocket._finishInit (_tls_wrap.js:643:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:473:38) code: 'CERT_HAS_EXPIRED' } ngrok - install failed { Error: certificate has expired at TLSSocket. (_tls_wrap.js:1116:38) at emitNone (events.js:106:13) at TLSSocket.emit (events.js:208:7) at TLSSocket._finishInit (_tls_wrap.js:643:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:473:38) code: 'CERT_HAS_EXPIRED' }

mrosati84 commented 1 year ago

having the same exact issue, but on Mac OS, anyone has a clue?

BrennerSpear commented 1 year ago

having the same issue on Mac OS

JOSEPH-THATO commented 7 months ago

upgrading to node 10.19.0 seems to have solved this issue for me on Mac OS M1 chip

russorat commented 3 months ago

Thank you for opening this issue! As of April 2016, the ngrok service has permanently moved to https://ngrok.com/. To join the community and file bug reports or feature enhancements for the ngrok agent, please go to https://github.com/ngrok/ngrok.

This repository is no longer actively maintained and will be archived soon to reduce confusion with the latest ngrok versions. We thank you for the continued support of ngrok and look forward to seeing you over at ngrok.com and the ngrok Community Repo.