Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

wskdebug cannot install on mac os mojave #22

Closed
tania-m opened this issue Nov 4, 2019 · 4 comments
Closed

wskdebug cannot install on mac os mojave #22

tania-m opened this issue Nov 4, 2019 · 4 comments

Comments

@tania-m
Copy link

tania-m commented Nov 4, 2019

I tried to install wskdebug on mac os mojave (with root privileges) using node version 12.

The installation keeps failing with following errors:

/usr/local/bin/wskdebug -> /usr/local/lib/node_modules/@adobe/wskdebug/index.js

fsevents@1.2.9 install /usr/local/lib/node_modules/@adobe/wskdebug/node_modules/fsevents
node install

Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/@adobe/wskdebug/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/@adobe/wskdebug/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)

ngrok@3.2.5 postinstall /usr/local/lib/node_modules/@adobe/wskdebug/node_modules/ngrok
node ./postinstall.js

ngrok - downloading binary https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-darwin-amd64.zip
ngrok - error storing binary to local file [Error: EACCES: permission denied, open '/usr/local/lib/node_modules/@adobe/wskdebug/node_modules/ngrok/bin/aHR0cHM6Ly9iaW4uZXF1aW5veC5pby9jLzRWbUR6QTdpYUhiL25ncm9rLXN0YWJsZS1kYXJ3aW4tYW1kNjQuemlw.zip'] {
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/usr/local/lib/node_modules/@adobe/wskdebug/node_modules/ngrok/bin/aHR0cHM6Ly9iaW4uZXF1aW5veC5pby9jLzRWbUR6QTdpYUhiL25ncm9rLXN0YWJsZS1kYXJ3aW4tYW1kNjQuemlw.zip'
}
ngrok - downloading progress: 0/13671591�[2K�[1Gngrok - downloading progress: 3768/13671591ngrok - error storing binary to local file Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
at doWrite (_stream_writable.js:427:19)
at writeOrBuffer (_stream_writable.js:415:5)
at WriteStream.Writable.write (_stream_writable.js:305:11)
at Transform.ondata (_stream_readable.js:726:22)
at Transform.emit (events.js:210:5)
at addChunk (_stream_readable.js:308:12)
at readableAddChunk (_stream_readable.js:289:11)
at Transform.Readable.push (_stream_readable.js:223:10)
at Transform.push (_stream_transform.js:150:32)
at Transform.afterTransform (_stream_transform.js:94:10) {
code: 'ERR_STREAM_DESTROYED'
}
�[2K�[1Gngrok - downloading progress: 19696/13671591ngrok - downloading binary https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-darwin-amd64.zip
ngrok - error storing binary to local file [Error: EACCES: permission denied, open '/usr/local/lib/node_modules/@adobe/wskdebug/node_modules/ngrok/bin/aHR0cHM6Ly9iaW4uZXF1aW5veC5pby9jLzRWbUR6QTdpYUhiL25ncm9rLXN0YWJsZS1kYXJ3aW4tYW1kNjQuemlw.zip'] {
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/usr/local/lib/node_modules/@adobe/wskdebug/node_modules/ngrok/bin/aHR0cHM6Ly9iaW4uZXF1aW5veC5pby9jLzRWbUR6QTdpYUhiL25ncm9rLXN0YWJsZS1kYXJ3aW4tYW1kNjQuemlw.zip'
}

It seems strange to me that accesses are missing. Any idea what could really go wrong?
Do I need to install ngrok locally as pre-requisite? If so, where?

@alexkli
Copy link
Contributor

alexkli commented Nov 4, 2019

Your local user might not have full write permissions on /usr/local/node_modules. I and others have seen this before on osx or also in containers. Seems like a general issue with global npm installs, if the OS or file system permission setup by default doesn’t allow the user to install global things.

This is what we do in a circle CI script - replace the circleci user id with yours:

sudo chown -R circleci /usr/local/ && chmod -R u+x+w /usr/local/

@alexkli
Copy link
Contributor

alexkli commented Nov 8, 2019

@tania-m Let me know if the above command doesn't fix the issue and we can reopen.

@alexkli alexkli closed this as completed Nov 8, 2019
@alexkli
Copy link
Contributor

alexkli commented Nov 12, 2019

It seems the culprit is at least ngrok which installs something extra: inconshreveable/ngrok#429

The permission change workaround is mentioned there as well, or the (crayz) command

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

@alexkli
Copy link
Contributor

alexkli commented Nov 19, 2019

Documented in b7494f4

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

2 participants