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

[BUG] Updating npm as instructed by npm fails #2031

Closed
rwoll opened this issue Oct 24, 2020 · 7 comments
Closed

[BUG] Updating npm as instructed by npm fails #2031

rwoll opened this issue Oct 24, 2020 · 7 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@rwoll
Copy link

rwoll commented Oct 24, 2020

Current Behavior:

npm fails to update in the v15.0.1 Docker container when trying the command npm prints out for updating.

$ docker run -it node:15.0.1 npm install -g npm@7.0.5
npm notice 
npm notice New patch version of npm available! 7.0.3 -> 7.0.5
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.0.5
npm notice Run npm install -g npm@7.0.5 to update!
npm notice 
npm ERR! code EXDEV
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! dest /usr/local/lib/node_modules/.npm-i9nnxROI
npm ERR! errno -18
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-10-24T01_54_22_453Z-debug.log

Expected Behavior:

Update completes successfully.

Steps To Reproduce:

$ docker run -it node:15.0.1 npm install -g npm@7.0.5

NB: It succeeds in the v14 docker image:

$ docker run -it node:14 npm install -g npm@7.0.5

Environment:

Docker version 19.03.13
macOS 10.15.7

@rwoll rwoll added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Oct 24, 2020
@KeyOnTech
Copy link

I'm getting the same error??? Started last night??? Did you figure out a solution??

Thanks for posting this i was going crazy thinking it was just mine...

@ikubij
Copy link

ikubij commented Oct 24, 2020

Me too, I just got this error from thursday 23rd, Anyone find a solution yet?

----EDIT----
Thanks @rwoll for starting the thread: Using node v14 worked for me too:

This is my docker file (working with Vue-nuxt)

FROM node:14-alpine as builder
.
.
RUN npm install npm@7
.
.

@KeyOnTech
Copy link

KeyOnTech commented Oct 24, 2020

So i made a new react app...
updated my docker file changed the from node version and its working... BUT THERE IS A BUT
this is working on my test clean react app still need to test on my actual app but the warning is gone now by changed the node version from latest to 14
and the error went away above that was showing up before step 5/7
and here is how i got it to work

open terminal on your mac

  1. create a new react app
    npx create-react-app delete-react-docker-app-1
    cd delete-react-docker-app-1

open visual studio code create a new file save it in this folder named as
Dockerfile

copy below and paste in the file everything in these slashes... //////

//////////////

FROM node:14

WORKDIR /usr/src/app

COPY package.json .

RUN npm install

COPY . .

EXPOSE 3000

CMD ["npm" , "start"]

//////////////

go back to terminal in this app directory
Run this in terminal to delete the image and container and then build the image and run the contanier
copy all below and paste in terminal

docker rm --force cntr_delete_react_docker_app_1_1_1
docker image rm --force img_delete_react_docker_app_1:1.1
docker build --tag img_delete_react_docker_app_1:1.1 .
docker run -it --publish 8011:3000 --detach --name cntr_delete_react_docker_app_1_1_1 img_delete_react_docker_app_1:1.1

on a mac you have docker desktop
go to the containers tab
when you see the container there, it takes a minute to create
now open your browser copy below and you should see the react demo page
http://localhost:8011/

Hope this helps now back to trying to make my real app work

@KeyOnTech
Copy link

FROM node:14

on your docker file not

FROM node:latest

@Harmelodic
Copy link

As I commented from here: nodejs/docker-node#1379


Likewise, getting the issue with all v15+ images.

I seem to be getting a Maximum call stack size exceeded error:
https://gitlab.com/harmelodic-group/scribbles/api/-/jobs/810274418

I made a tiny little test repo here, to display the issue: https://github.com/Harmelodic/test

Reproduce by:

$ git clone https://github.com/Harmelodic/test
$ docker build .

Temp workaround for me, until v15 is fixed:

FROM node:14

@ttshivers
Copy link

Related: #606

@mhart
Copy link
Contributor

mhart commented Oct 28, 2020

Duplicate of #606

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants