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

support npm v9 #152

Closed
yshrsmz opened this issue Nov 18, 2022 · 6 comments · Fixed by #157
Closed

support npm v9 #152

yshrsmz opened this issue Nov 18, 2022 · 6 comments · Fixed by #157

Comments

@yshrsmz
Copy link
Member

yshrsmz commented Nov 18, 2022

https://github.com/npm/cli/blob/latest/CHANGELOG.md#features-8
npm/statusboard#537

npm v9 removes bin command which this action uses.

action output:

🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog
 Running `npm install` to install eslint ...
/home/runner/work/_actions/reviewdog/action-eslint/v1/script.sh: 20: Unknown: not found
eslint version:
 Running eslint with reviewdog 🐶 ...
Error: Process completed with exit code 1.
@yshrsmz
Copy link
Member Author

yshrsmz commented Nov 18, 2022

Should we simply use npx instead?

@rpellerin
Copy link

With NodeJS 19.3 being out now, supporting npm v9 would be much appreciated 😊

@Djiit
Copy link

Djiit commented Jan 9, 2023

Hey team, really looking forward using this feature. How can we help ?

@yshrsmz
Copy link
Member Author

yshrsmz commented Jan 20, 2023

https://docs.npmjs.com/cli/v7/commands/npm-exec

npm exec --offline eslint --version or npx --offline eslint --version fails if no eslint binary exists locally, so we could first use either of these commands, and if it fails then calling npm install and do actual linting.

@yshrsmz yshrsmz mentioned this issue Jan 20, 2023
silvestre added a commit to cloudfoundry/app-autoscaler-release that referenced this issue Feb 6, 2023
silvestre added a commit to cloudfoundry/app-autoscaler-release that referenced this issue Feb 6, 2023
@mpowell90
Copy link

Just ran into this issue. A workaround is to target node-version: 16, which bundles an older version on npm until v9 support is added.

@remnantkevin
Copy link

Just ran into this issue. A workaround is to target node-version: 16, which bundles an older version on npm until v9 support is added.

@mpowell90 Thanks for the suggested workaround 👍

Where I work we had set the node-version to 18 for actions/setup-node@v3. Last week, 18 was resolving to 18.13 in our workflow runs, while this week it resolved to 18.14. According to the Node.js releases page, 18.13 comes bundled with npm v8, while 18.14 comes bundled with npm v9. So for now we have pinned the minor version of node to ensure we're using npm v8:

      - uses: actions/setup-node@v3
         with:
           node-version: '18.13'
           cache: 'yarn'

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 a pull request may close this issue.

5 participants