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 npm version compatibility & depreciation msg #152

Merged
merged 1 commit into from
May 16, 2023
Merged

Fix npm version compatibility & depreciation msg #152

merged 1 commit into from
May 16, 2023

Conversation

Loki-101
Copy link

The latest version of NPM for NodeJS 17 going off https://nodejs.org/en/download/releases is 8.11.0. Leaving it as @latest results in the following error during build:

=> ERROR [3/5] RUN npm install npm@latest--location=global 0.9s

[3/5] RUN npm install npm@latest--location=global:
#0 0.846 npm ERR! code EINVALIDTAGNAME
#0 0.847 npm ERR! Invalid tag name "latest--location=global" of package "npm@latest--location=global": Tags may not have any characters that encodeURIComponent encodes. #0 0.849
#0 0.849 npm ERR! A complete log of this run can be found in:
#0 0.849 npm ERR! /root/.npm/_logs/2023-05-14T21_06_16_353Z-debug-0.log


Dockerfile:9

7 | && useradd -m -d /home/container container
8 |
9 | >>> RUN npm install npm@latest--location=global
10 |
11 | USER container

ERROR: failed to solve: process "/bin/sh -c npm install npm@latest--location=global" did not complete successfully: exit code: 1

Additionally, there was a message during build about -g being depreciated and using --location=global instead, so I figured as long as I'm making a change to this anyways I may as well switch that out. With the first change it builds successfully, with the second change it builds successfully without the depreciation message.

Description

All Submissions:

  • Have you ensured there aren't other open Pull Requests for the same update or change?
  • Have you created a new branch for your changes and PR from that branch and not from your master branch?

New Image Submissions:

  1. Have you added your image to the Github workflows?
  2. Have you updated the README list to contain your new image?

The latest version of NPM for NodeJS 17 going off https://nodejs.org/en/download/releases is 8.11.0. Leaving it as @latest results in the following error during build:

 => ERROR [3/5] RUN         npm install npm@latest--location=global                                                                                                                                                                                                                                                     0.9s
------                                                                                                                                                                                                                                                                                                                       
 > [3/5] RUN         npm install npm@latest--location=global:
#0 0.846 npm ERR! code EINVALIDTAGNAME
#0 0.847 npm ERR! Invalid tag name "latest--location=global" of package "npm@latest--location=global": Tags may not have any characters that encodeURIComponent encodes.
#0 0.849 
#0 0.849 npm ERR! A complete log of this run can be found in:
#0 0.849 npm ERR!     /root/.npm/_logs/2023-05-14T21_06_16_353Z-debug-0.log
------
Dockerfile:9
--------------------
   7 |                 && useradd -m -d /home/container container
   8 |     
   9 | >>> RUN         npm install npm@latest--location=global
  10 |     
  11 |     USER        container
--------------------
ERROR: failed to solve: process "/bin/sh -c npm install npm@latest--location=global" did not complete successfully: exit code: 1


Additionally, there was a message during build about -g being depreciated and using --location=global instead, so I figured as long as I'm making a change to this anyways I may as well switch that out. With the first change it builds successfully, with the second change it builds successfully without the depreciation message.
@Loki-101
Copy link
Author

It looks like the other images also have npm@latest, but are building successfully. Not sure why this one is different.
image

@Loki-101
Copy link
Author

Danny figured out why @latest no longer works for this build: npm/statusboard#519
Node no longer supports version 17, so the engine stopped supporting it. The other old versions still work because even versions are more stable; support hasn't been dropped for them.

Copy link
Collaborator

@QuintenQVD0 QuintenQVD0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@QuintenQVD0 QuintenQVD0 merged commit c9dc517 into pelican-eggs:master May 16, 2023
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

Successfully merging this pull request may close these issues.

2 participants