CircleCI-Public / CircleCI-Public/cimg-python

Node variant: NPM fails with EACCES error when installing package

Open
#233 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Dockerfile
Stars
36
Forks
33
PR merge metrics
No merged PRs in 30d

Description

**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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.