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

Can't run npm 8.11.0 on Openshift/OKD #1736

Open
KingKunn opened this issue Jun 9, 2022 · 3 comments
Open

Can't run npm 8.11.0 on Openshift/OKD #1736

KingKunn opened this issue Jun 9, 2022 · 3 comments

Comments

@KingKunn
Copy link

KingKunn commented Jun 9, 2022

Environment

  • OKD4.10/Openshift:
  • cri-o 1.23.0, 1.11.15
  • node16
  • node:16-alpine, node:16-bullseye-slim

Expected Behavior

npm can be executed on OKD/Openshift without root permissions

Current Behavior

Built Node16 application can't be started on OKD/Openshift platform, as npm binary or related folder/file permissions do not have enough privileges?

Possible Solution

  • Using older node:16-alpine, node:16-bullseye-slim images, where npm version is 8.5.5.
  • Remove NPM and start application via node with -> package.json start command

Steps to Reproduce

Using latest node:16-alpine, node:16-bullseye-slim images to build and run node application.
Application runs on local docker container, but when deploying to OKD/Openshift... then container will crash-loop as npm command is not working properly - no output - blank row

Output in Container:

/usr/src/app $ node -v
v16.15.1
/usr/src/app $ npm -v

/usr/src/app $ npm --help

/usr/src/app $ env
...
NODE_VERSION=16.15.1
YARN_VERSION=1.22.19
...

/usr/src/app $ whoami
whoami: unknown uid 1000250000

npm command works on OKD4 when granting root permissions to the container, but this can't be used for security reasons.

Additional Information

Probably this is not my platform/image issue

@xitox97
Copy link

xitox97 commented Jun 10, 2022

Having this issue as well. npm command returning nothing. Downgrade to different node version then only can uses npm. Do you have any solution?

@soulchild
Copy link

This is most likely related to #1734 and npm/cli#4996

@kavana-14
Copy link

kavana-14 commented May 31, 2024

will it work on npm 9.5.1, i'm having issue with cache directory
The issue arises because npm is trying to use /.npm as its cache directory, which typically requires root permissions. I'm try to create a react app on openshift, but after deployment when I rsh into my container shell and execute the npm start command i'm getting the error /.npm EACCESS. How to solve it .
The npm cache directory is set to a location where the user has appropriate permissions, avoiding permission issues.

npm: 9.5.1
Node.js: 18.16.0
OS Name: ubuntu 22.04
#7572

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@soulchild @xitox97 @KingKunn @kavana-14 and others