-
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
Unable to set global npm version, npm v8 is always used... #376
Comments
i should add: this pipeline has been working without issue for months. my last successful run was ~7days ago (11/30/2021 - log). i noticed things failing starting yesterday (12/6/2021) edit: comparing the last successful run to my recent failures, i see edit: this seems relevant 👉 actions/runner#1439 edit: doesn't look like i can downgrade the runner itself ☠️ edit: actions/runner#1439 (comment) seems to confirm my expectation that |
Your repository is private and I cannot see the runs. When I try to reproduce this, I am running the expected versions of node and npm after running setup-node. steps:
- uses: actions/setup-node@v2
with:
node-version: '12'
- name: Debug
env:
NPM_TOKEN: foobar
run: |
echo ":::: NPM SETTINGS"
node --version
npm --version shows:
Is this what you're seeing? Or are you seeing something different from |
@ethomson thanks for taking a look 🙏
correct. i'm running a tool via the
as you are a Github employee, i'm happy to grant you access. fwiw, we are a Github Enterprise customer (info). if it's helpful, i can file a ticket. |
ok, should have done this from the beginning but better late than never. running locally (edit: outside of GH Actions entirely), i'm able to reproduce the warnings and subsequent failures by simply running under so the question really boils down to: why would a call to execute |
I should also note that I’m using the setup-node action to control node + npm versions as well (not exclusively via
|
Hello @busticated. Thank you for your report. Could you please provide a public repository to reproduce the issue. I've tried from my side, but it works as expected. |
I don't have an answer for you - I'd love to know if
is producing the expected values? Expanding on this, I'd love to know what you're seeing here:
For this, I get all the expected outputs:
If you're seeing this, too, then I think that your question here is very interesting, indeed:
I'd love to know how you're invoking npm from this Node.js script. |
thanks @ethomson 🙏 i ran the debug step you provided along with a few more bits like changing directories to see if that mattered any and got the same results as you did: the code that is executing is somewhat tricky:
i patched the underlying lib to output more debugging info and discovered something interesting. all of the
(with a bunch of noise omitted) so, at some point this code starts seeing i then tried running the but here's the wrinkle - the is that likely to be the culprit? and what changed to cause failures now? is it down to the base environment change rolled out in https://github.com/actions/runner/releases/tag/v2.285.0 ? |
ok, well adding i suppose you can close this out - thanks for the help 🙏 👍 |
oho tenku |
god blesu evribare |
Hello everyone. For now I'm closing the issue. If you have any concerns feel free to contact us. |
Description:
I need to run my action using
npm@6
. Despite installing the correct version globablly,npm@8
is always used and my action fails. i see a series of warnings in my logs like:i first noticed the failure on monday (12/6/2021), the last successful run was ~7days ago (11/30/2021 - log)
inspecting the logs for both runs, i see
Current runner version: '2.284.0'
(success) vs.Current runner version: '2.285.1'
(fail). looks like the earliest failure happened underCurrent runner version: '2.285.0'
which was released ~8days ago (info)running locally (outside of GH Actions entirely but within a comparable environment), i'm able to reproduce the warnings and subsequent failures by simply using
npm@8
. at no point does my code attempt to installnpm@8
. reverting tonpm@6
and re-running fixes things.the
Unsupported engine
warnings are triggered by running a tool which itself runsnpm
via child-process in a descendant directory (see here). this is what mynpm run build
command does under the hood.interestingly, Node.js
v12.22.7
ships w/npm@6.14.15
by default (see ~pg10 here) so something is explicitly pulling innpm@8.1.0
somewhereAction version:
v2.5.0
,v2.4.1
, andv2.4.0
Platform:
Runner type:
Tools version:
node:
v12.22.7
npm:
6.14.15
(butnpm@8.1.0
is always used)Repro steps:
Using an action step like:
(note: using either
ubuntu-18.04
orubuntu-latest
yields the same result)Expected behavior:
npm run build
command succeeds,npm@6
is usedActual behavior:
npm run build
fails with the following log output:npm@8
is used despite previously installingnpm@6
vianpm i npm@6 --global
and despite Node.jsv12.22.7
shipping withnpm@6.14.15
by defaultThe text was updated successfully, but these errors were encountered: