Skip to content

Codespaces - global npm module requiring node-gyp rebuild ( jq ) fails - EACCES ERROR #101144

@dehru

Description

@dehru
  • VSCode Version: June 2020 (1.47.0-insider)
  • OS Version: June 2020 (version 1.47) - Insiders Build

Steps to Reproduce:

  1. Create a new environment
  2. Try to globally install an npm module that requires an OS specific rebuild ( node-gyp )
    npm i -g jq
  3. node-gyp throws EACCES error during post install build step
> node-gyp rebuild

gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/root/.cache/node-gyp/12.18.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/jq/node_modules/contextify/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/jq/node_modules/contextify/.node-gyp'
gyp ERR! System Linux 5.3.0-1028-azure
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/jq/node_modules/contextify
gyp ERR! node -v v12.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: contextify@0.1.15 (node_modules/jq/node_modules/contextify):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: contextify@0.1.15 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

Does this issue occur when all extensions are disabled?: Yes

Version: 1.47.0-insider
Commit: b9d7ec9
Date: 2020-06-19T22:25:04.581Z (6 days ago)
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions