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

npm warnings cause the action to fail #352

Closed
2 of 5 tasks
novemberborn opened this issue Oct 30, 2021 · 2 comments
Closed
2 of 5 tasks

npm warnings cause the action to fail #352

novemberborn opened this issue Oct 30, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@novemberborn
Copy link

Description:
npm, as run within this action, is emitting warnings due to my .npmrc file. These then fail the action.

Action version:
v2 (not sure how to tell exactly what GHA selected)

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
Node.js ^16.4

Repro steps:
With avajs/ava#2867 I'm configuring lockfile-version=3 in my .npmrc file. The npm version that is installed through the action does not recognize this option.

See this run: https://github.com/avajs/ava/runs/4055643495?check_suite_focus=true

Expected behavior:
The warning is emitted but the action completes successfully.

Actual behavior:
The action fails.

@dmitry-shibanov
Copy link
Contributor

Hello @novemberborn. Thank you for your report. As you described in feature request with adding npm_version for npm 7 support, lokfile-version 3 is only supported by npm 8. You're using built-in caching of the action. The Action calls npm config get cache to get global cache directory, that is why you get warning and error. As temporary workaround I suggest:

  • remove .npmrc in the time of the building if it's not necessary.
  • remove built-in caching for node and use actions/cache
  • You can try to use the action twice
     - uses: actions/setup-node@v2
       with:
         node-version: ${{ matrix.node-version }}
     - name: Upgrade npm
       run: npm install --global npm@^8.1.2
     - uses: actions/setup-node@v2
       with:
         node-version: ${{ matrix.node-version }}
         cache: npm
  • Add --lockfile-version as configuration option.

@dmitry-shibanov
Copy link
Contributor

Hello @novemberborn. We released a new version of the action to resolve the bug with falling on warning. For now it should work as expected.
I'm going to close the issue. If you have any concerns feel free to ping us.

deining pushed a commit to deining/setup-node that referenced this issue Nov 9, 2023
* add check to allow empty commits if arg is set

* fix: target only the desired argument

* fix: add debug message

* fix: fix debug message

Co-authored-by: Federico Grandi <fgrandi30@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants