-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow to set a custom npm version with npm_version
option
#213
Comments
Hello! If you need npm 7 for previous versions of Node.JS, please consider upgrading it in runtime via |
@maxim-lobanov Would it be possible to make it configurable like I suggested by using an option? It would allow to easily use matrix too |
Is it not enough to add |
npm publish doesn't work with node 15.x in github actions:
when I downgrade to node 12 it works again |
It seems setting |
Just like we have an option to use |
Using |
What about doing with sudo? |
@smorimoto I don't know why I didn't think about it! So, running 2021-03-10T18:20:25.6852244Z ##[group]Run sudo npm i -g npm@latest
2021-03-10T18:20:25.6852862Z sudo npm i -g npm@latest
2021-03-10T18:20:25.6906055Z shell: /usr/bin/bash -e {0}
2021-03-10T18:20:25.6906509Z env:
2021-03-10T18:20:25.6906931Z node-version: 14
2021-03-10T18:20:25.6907390Z ##[endgroup]
2021-03-10T18:20:37.6677894Z /usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
2021-03-10T18:20:37.6683622Z /usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
2021-03-10T18:20:37.7550998Z + npm@7.6.2
2021-03-10T18:20:37.7552906Z added 59 packages from 24 contributors, removed 241 packages and updated 194 packages in 10.209s
2021-03-10T18:20:37.7743170Z ##[group]Run echo npm version "$(npm --version)"
2021-03-10T18:20:37.7743827Z echo npm version "$(npm --version)"
2021-03-10T18:20:37.7744307Z echo node version "$(node --version)"
2021-03-10T18:20:37.7790961Z shell: /usr/bin/bash -e {0}
2021-03-10T18:20:37.7791313Z env:
2021-03-10T18:20:37.7791661Z node-version: 14
2021-03-10T18:20:37.7792014Z ##[endgroup]
2021-03-10T18:20:38.3912711Z npm version 6.14.11
2021-03-10T18:20:38.3966163Z node version v14.16.0 You can see that after updating I've never had to use SOLUTION: After some trial and error, I figure it out. Updating |
I suspect that the path priority is wrong. The following command should tell you the order, but it probably shows the one installed by the action at the top.
If it's true, you need to change the priority, but it can be a little tricky. For example, create a new directory, create a symbolic link to npm, and add it to the path through the Actions command. |
Oh, it's good. |
* Add option to build with webpack bundle analyzer * Bump npm to v7 as recommended in actions/setup-node#213 * Workaround for npm/cli#558 * Add missing dep
Solution - name: npm 7
run: npm i -g npm@7 --registry=https://registry.npmjs.org |
Fixes #3 . This package now supports npm v7+. While Node.js v12 and v14 should be supported (with npm updated to v7+), this isn’t easy to test in GitHub Actions CI as actions/setup-node@v2 doesn’t allow the npm version to be configured, see: actions/setup-node#213 .
I hope to soon see an option to pass |
We've recently hit this issue. The |
thanks @fcastilloec
output
|
See for installing the correct npm version: actions/setup-node#213 (comment)
See for installing the correct npm version: actions/setup-node#213 (comment)
See for installing the correct npm version: actions/setup-node#213 (comment)
I'm also noticing that potentially our |
The `package-lock.json` is now created with NPM 7 (`lockfileVersion@2). The `setup-node@v2` uses NPM 7 only if `node-version` is set to be `15` (source: actions/setup-node#213)
The `package-lock.json` is now created with NPM 7 (`lockfileVersion@2). The `setup-node@v2` uses NPM 7 only if `node-version` is set to be `15` (source: actions/setup-node#213)
The `package-lock.json` is now created with NPM 7 (`lockfileVersion@2). The `setup-node@v2` uses NPM 7 only if `node-version` is set to be `15` (source: actions/setup-node#213)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.26.0 to 4.26.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.26.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Can this issue be renamed to drop the mention of |
npm_version
for npm 7 supportnpm_version
for npm custom version support
npm_version
for npm custom version supportnpm_version
option
@fregante Done |
Note that Node is considering removing npm and having corepack install it, which would make this unnecessary if corepack was implemented. |
Is there a way to setup the action to use npm 7?
What about
npm_version: 7
like actually it's done fornode_version
?The text was updated successfully, but these errors were encountered: