Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Michal Bryxí
Michal Bryxí

Posted on

sh: 1: node: Permission denied on `volta install`

Earlier this week I started seeing failures on myDocker builds with a rather cryptic message:sh: 1: node: Permission denied. This was really strange, because I did not change anything significant enough to cause this error. Example of failing logs:

Fornetlify-cli:

Step 17/18 : RUN volta install netlify-cli --verbose ---> Running in 53c120c8aebb[verbose] Acquiring lock on Volta directory: /root/.volta/volta.lock[verbose] Found default configuration at '/root/.volta/tools/user/platform.json'[verbose] node@12.19.0 has already been fetched, skipping download[verbose] yarn@1.22.10 has already been fetched, skipping download[verbose] Installing netlify-cli with command: "npm" "install" "--global" "--loglevel=warn" "--no-update-notifier" "--no-audit" "netlify-cli"[verbose] [install stderr]npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecatednpm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecatednpm WARN deprecated object-keys@0.2.0: Please update to the latest object-keyssh: 1: node: Permission deniednpm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/netlify-cli/node_modules/rollup/node_modules/fsevents):npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})npm WARN @octokit/plugin-request-log@1.0.1 requires a peer of @octokit/core@>=3 but none is installed. You must install peer dependencies yourself.npm ERR! code ELIFECYCLEnpm ERR! syscall spawnnpm ERR! file shnpm ERR! errno ENOENTnpm ERR! netlify-cli@2.65.7 postinstall: `node ./scripts/postinstall.js`npm ERR! spawn ENOENTnpm ERR!npm ERR! Failed at the netlify-cli@2.65.7 postinstall script.npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Enter fullscreen modeExit fullscreen mode

Forember-cli:

Step 17/18 : RUN volta install ember-cli netlify-cli --verbose ---> Running in c09e5ec1b6cf[verbose] Acquiring lock on Volta directory: /root/.volta/volta.lock[verbose] Found default configuration at '/root/.volta/tools/user/platform.json'[verbose] node@12.19.0 has already been fetched, skipping download[verbose] yarn@1.22.10 has already been fetched, skipping download[verbose] Installing ember-cli with command: "npm" "install" "--global" "--loglevel=warn" "--no-update-notifier" "--no-audit" "ember-cli"[verbose] [install stderr]npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecatednpm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecatednpm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.sh: 1: node: Permission deniednpm ERR! code ELIFECYCLEnpm ERR! syscall spawnnpm ERR! file shnpm ERR! errno ENOENTnpm ERR! core-js@2.6.11 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`npm ERR! spawn ENOENTnpm ERR! npm ERR! Failed at the core-js@2.6.11 postinstall script.
Enter fullscreen modeExit fullscreen mode

The error message looks slightly different in each case.

What Ithink is the problem: In myDocker container, I'm usingVolta for node/yarn version management. And for thevolta install command it internally usesnpm install --global, which does not like to run when the script is executed asroot.

So the solution was to add following line to myDockerfile just before thevolta install command:

RUN npm set unsafe-perm true
Enter fullscreen modeExit fullscreen mode

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Cycle 🚴 , climb 🗻 , run 🏃 , travel 🌍 , enjoy life ♥.IT guy with the need to live fully.
  • Location
    Interlaken, Switzerland
  • Education
    University of West Bohemia
  • Pronouns
    he/him
  • Work
    Sandcastle Architect
  • Joined

More fromMichal Bryxí

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp