The user, group, uid, gid, and unsafe-perms configurations are no longer relevant. When npm is run as root, scripts are always run with the effective uid and gid of the working directory owner.
The environment variable npm_config_unsafe_perm is no longer needed or used, since the current lowest supported version of npm (8.6.0) is higher than the version where its used was removed (7.0.0). Even considering Node.js 16.0.0 the lowest npm version is 7.10.0, which is already higher than the version where unsafe_perm was removed.
cd factory
docker compose build factory
docker compose build
cd test-project
set -a && . ../.env && set +a
docker compose run test-factory-all-included
docker compose run test-factory-cypress-included-electron-non-root-user
Issue
https://github.com/cypress-io/cypress-docker-images/blob/b32255e644878bdbdf88e209f827c2ae47e24095/factory/factory.Dockerfile#L14-L15 sets an environment variable:
This environment variable is obsolete.
Background
The lowest supported Node.js version is Node.js 18.0.0 which bundles npm
8.6.0
. (See Node.js Release schedule.)The npm CHANGELOG 7.0.0 > All Lifecycle Scripts says:
The environment variable
npm_config_unsafe_perm
is no longer needed or used, since the current lowest supported version of npm (8.6.0
) is higher than the version where its used was removed (7.0.0
). Even considering Node.js 16.0.0 the lowest npm version is7.10.0
, which is already higher than the version whereunsafe_perm
was removed.Change
Remove the environment variable
npm_config_unsafe_perm
from the factory/factory.Dockerfile file.Bump
FACTORY_VERSION
.Verification