0

I am trying to follow the steps listed here but keep getting an error when trying to install shoutem-cli - $ npm install -g @shoutem/cli

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngrok@2.2.21 postinstall: `node ./postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ngrok@2.2.21 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional log                                     ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-08-24T13_20_31_973Z-debug.log

The log file can be found here.

If you need more info, please let me know.

I tried searching for these errors or common issues and had 0 luck so I'm not sure where to begin. Any help would be greatly appreciated.

Thanks!

UPDATE: After reading the answer below and asked to rerun I get this error:

npm WARN deprecated babel-preset-node7@1.5.0: Use https://github.com/babel/babel-preset-env instead.
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/shoutem -> /usr/local/lib/node_modules/@shoutem/cli/src/shoutem.js

> ngrok@2.2.17 postinstall /usr/local/lib/node_modules/@shoutem/cli/node_modules/ngrok
> node ./postinstall.js

ngrok - downloading binary https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: EACCES: permission denied, open '/usr/local/lib/node_modules/@shoutem/cli/node_modules/ngrok/ngrok.zip'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngrok@2.2.17 postinstall: `node ./postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ngrok@2.2.17 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-08-24T21_53_55_950Z-debug.log
iamthestreets
  • 733
  • 1
  • 15
  • 38
  • `EACCES: permission denied, open '/usr/local/lib/node_modules/@shoutem/cli/node_modules/ngrok/ngrok.zip'`. might indicate invalid npm permissions setup. Can you follow the tutorial [here](https://docs.npmjs.com/getting-started/fixing-npm-permissions) and see if it resolves the issue? You should be able to write to `/usr/local/lib/node_modules/` under your account. – dodsky Aug 25 '17 at 07:38
  • @dodsky I tried that and still nothing – iamthestreets Aug 25 '17 at 12:23
  • Can you try running the npm install with sudo? I'm just trying to confirm that it's permission related issue as the error indicates. It should work without it in normal circumstances. – dodsky Aug 27 '17 at 09:49
  • same error with `sudo`. – iamthestreets Aug 28 '17 at 18:40
  • Please see my answer on https://github.com/shoutem/cli/issues/21 – dodsky Aug 29 '17 at 21:33

1 Answers1

0

This seems to be related to ngrok@2.2.21 postinstall script. Doing a quick investigation, there seems to be some Ubuntu related issues - here. From what I can tell it seems to be permission related. We'll try to find a working version and restrict our CLI semver until this is resolved, we've already published the new version of CLI which restricts ngrok to 2.2.17 in an effort to resolve this (CLI version 0.9.4 - just run again npm install -g @shoutem/cli). We're using ngrok to ease up connections between React Native packager on your development machine and your phone.

dodsky
  • 504
  • 4
  • 11