Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove obsolete environment variable npm_config_unsafe_perm #1078

Merged

Conversation

MikeMcC399
Copy link
Collaborator

Issue

# allow installing when the main user is root
npm_config_unsafe_perm=true \
sets an environment variable:

npm_config_unsafe_perm: true

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

Change

Remove the environment variable npm_config_unsafe_perm from the factory/factory.Dockerfile file.

Bump FACTORY_VERSION.

Verification

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

@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 self-assigned this May 31, 2024
@MikeMcC399

This comment was marked as outdated.

@MikeMcC399 MikeMcC399 marked this pull request as ready for review May 31, 2024 07:11
@jennifer-shehane jennifer-shehane merged commit 3763fc5 into cypress-io:master May 31, 2024
31 checks passed
@MikeMcC399 MikeMcC399 deleted the remove/env-var-unsafe-perm branch May 31, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants