Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

npm installation fails #429

Closed
bserem opened this issue Jun 28, 2017 · 33 comments
Closed

npm installation fails #429

bserem opened this issue Jun 28, 2017 · 33 comments

Comments

@bserem
Copy link

bserem commented Jun 28, 2017

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
Copy link

@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
Copy link

Same issue here on Mac OS Sierra, npm 5.3.0

@rubensbarreto
Copy link

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
Copy link

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
Copy link

sanchil commented Dec 22, 2017

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
Copy link

bcollazo commented Jan 27, 2018

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

@AllanDaemon
Copy link

AllanDaemon commented Jan 31, 2018

Same problem here. Using Arch linux.

@cskonopka
Copy link

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
Copy link

gabe2code commented Feb 7, 2018

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
Copy link

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

@LongBeachHXC
Copy link

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

@bitbadger-io
Copy link

bitbadger-io commented Feb 23, 2018

Same here, brand new Ubuntu build Xenial under virtualbox

@LongBeachHXC
Copy link

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
Copy link

pjm4 commented Mar 6, 2018

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
Copy link

ankibalyan commented Mar 8, 2018

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

@breart
Copy link

breart commented Mar 27, 2018

@ankibalyan doesn't work on MacOS High Sierra

@breart
Copy link

breart commented Mar 27, 2018

This one did the trick for me:

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

@LongBeachHXC
Copy link

brezzhnev...that also worked for me.

@brownbl1
Copy link

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

@breart
Copy link

breart commented May 30, 2018

@brownbl1 just grabbed from here: appium/appium#10293 (comment)

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
Copy link

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

livesafer!

@bserem
Copy link
Author

bserem commented Jan 30, 2019

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

@super-kamil
Copy link

Same problem on Windows 10. Will this be fixed?

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

It only works with unsafe-perm param.

@technocrat2050
Copy link

This one did the trick for me:

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

It worked for me... great, thanks

@princefishthrower
Copy link

princefishthrower commented Jul 27, 2020

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 bubenshchykov/ngrok#115 (comment)

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

nevergone added a commit to nevergone/docker-lagoon that referenced this issue Dec 10, 2021
@safweb89
Copy link

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
Copy link

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

@VanitaKate
Copy link

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
Copy link

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
Copy link

mrosati84 commented Jan 18, 2023

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

@BrennerSpear
Copy link

having the same issue on Mac OS

@JOSEPH-THATO
Copy link

JOSEPH-THATO commented Jan 22, 2024

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

@russorat
Copy link
Collaborator

russorat commented May 9, 2024

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.

@russorat russorat closed this as completed May 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests