halfzebra/create-elm-app

create-elm-app install fails under Alpine Linux 3.7.0

Closed this issue · 3 comments

Is this a bug report?

Yes

Environment

  1. node -v: 8.9.4
  2. npm -v: 6.0.1
  3. yarn --version (if you use Yarn): N/A
  4. npm ls create-elm-app -g (if you haven’t ejected): N/A

Then, specify:

  1. Operating system: Alpine Linux 3.7.0
  2. Browser and version (if relevant): N/A

Steps to Reproduce

  1. Install Node using apk add nodejs
  2. Install Npm using apk add nodejs-npm
  3. Run the command npm install create-elm-app -g

Expected Behavior

Should install the create-elm-app package globally.

Actual Behavior

The create-elm-app package install fails with the following error

npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
/usr/bin/elm-app -> /usr/lib/node_modules/create-elm-app/bin/elm-app-cli.js
/usr/bin/create-elm-app -> /usr/lib/node_modules/create-elm-app/bin/create-elm-app-cli.js

> elm@0.18.0 install /usr/lib/node_modules/create-elm-app/node_modules/elm
> node install.js

Error extracting linux-x64.tar.gz - Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/create-elm-app/node_modules/elm/Elm-Platform'
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.3 (node_modules/create-elm-app/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/create-elm-app/node_modules/elm-test/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! elm@0.18.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the elm@0.18.0 install 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/2018-05-15T08_15_06_824Z-debug.log

Attaching the debug log 2018-05-15T08_15_06_824Z-debug.log

Hi @thesobercoder, thanks for reporting this issue.

Unfortunately, the problem is caused by the permissions elm-lang/elm-platform, and there's nothing I could do about it.

To solve this, you could either use sudo as described here or fix this problem forever by configuring npm to stop downloading stuff into /usr/lib

I will close this issue, but please feel free to re-open it or post additional questions/comments if you require any further help 🙂

I'm using the root user so I don't think its a permission issue. Wonder what else is going on!

@thesobercoder @halfzebra I could be wrong but I do not think this is a permission problem.

I tried running a npm i -g create-elm-app on a clean node:8.15-alpine pull and ran into the same problem. I tried executing the mkdir manually and the problem was more that part of the path do not exists so it failed. If I add a -p flag, the mkdir command works.

Here's a recorded screencap of it. It's a bit long but you can fast-forward through the waiting for npm downloads.

I'm not sure where exactly I can send this patch to. I will investigate more if I have time.