cimg-python icon indicating copy to clipboard operation
cimg-python copied to clipboard

Node variant: NPM fails with EACCES error when installing package

Open tkapuranis opened this issue 11 months ago • 0 comments

Describe the bug npm global install fails with EACCES error when using latest node variant image for python 3.11.

To Reproduce Install an npm package globally

npm-install:
    resource_class: small
    docker:
      - image: cimg/python:3.11-node
    steps:
      - run:
          name: Install junit-merger
          command: |
            npm install -g junit-report-merger

Results in

npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/junit-report-merger
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/junit-report-merger'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/junit-report-merger'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/junit-report-merger'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in: /home/circleci/.npm/_logs/2024-03-11T20_27_47_096Z-debug-0.log

Exited with code exit status 243

Expected behavior Package is installed and available

Workarounds Explicitly using the previous 3.11 version (cimg/python:3.11.7-node) works as expected

tkapuranis avatar Mar 11 '24 20:03 tkapuranis