-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
npm downgraded to 5.x if default version is 10.x #1140
Labels
Comments
Similarly, I noticed some new warnings present that are due to the same bug in the code.
which comes from heroku-buildpack-nodejs/lib/failure.sh Line 760 in c14b37d
I searched the code and found it may also present a problem here heroku-buildpack-nodejs/lib/failure.sh Line 748 in c14b37d
|
colincasey
added a commit
that referenced
this issue
Sep 20, 2023
Several checks of the `major` version of npm being used were only accounting for the first character of the version string. E.g.; version `10.1.0` would be treated as `major=1` instead of `major=10`. This PR changes those checks to split on `.` characters using `cut` and read the `major` version as the first field and adds a test to verify. Fixes #1140
colincasey
added a commit
that referenced
this issue
Sep 25, 2023
* Fix downgrade to npm 5.x when using version 10.x or greater Several checks of the `major` version of npm being used were only accounting for the first character of the version string. E.g.; version `10.1.0` would be treated as `major=1` instead of `major=10`. This PR changes those checks to split on `.` characters using `cut` and read the `major` version as the first field and adds a test to verify. Fixes #1140
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Now that the default npm version for node 20.7 is 10.1.0, if an npm version is not specified it will be incorrectly downgraded to 5.x
To Reproduce
Steps to reproduce the behavior:
Specify
"engines": { "node": "20.x" }
in your package.json file (note that"npm"
is not specified)Build your app on Heroku
In the build log you'll see something like:
Your build will probably fail with some obscure error message later
Versions (please complete the following information):
heroku-22
20.7.0
10.1.0
heroku/nodejs v221
Additional context
The issue originates from this line, which only looks at the first character of the default node version:
heroku-buildpack-nodejs/lib/binaries.sh
Line 115 in c14b37d
The text was updated successfully, but these errors were encountered: