-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 install npm@version not working on the mac image #31
Comments
This is a fair suggestion, and one I've given some thought to, but I think we're probably not going to do this. We've had some discussion surrounding this, but in general, we view the setup-* actions as actions to setup the tool but not the ecosystem around it - so the setup actions should work like node's installer executable does. Npm is a little bit of a tricky case because the installer packages npm with Node, so its not clear where the tool ends and the ecosystem starts. For now, though, we've decided to adopt the same behavior as the installer executable and not install different versions of npm and/or Yarn. FWIW, I'm also a little less worried about this one because its relatively easy to fix - just add a step Does that make sense/seem reasonable? |
It is reasonable and the first thing I tried, but it seemed like the global install worked but was not effective (so my next steps that ran still used the old version). Maybe I did something wrong, but getting npm@6 using node 8.10 didn't work, like: npm i -g npm@6
npm ci failed with 'ci' not being a known command (it looked like npm@5 was still the one in effect) Let me check if I did something wrong and I'll get back to you. If it works, the debate is basically do we want to save half a dozen characters - which I agree is probably not worth it! If not, I'm not sure what would be needed to make it work |
Huh, that's weird. If that's not working, we definitely should fix that! With that said, I'm not able to reproduce. Could you try running Also, if your repo is public would you mind sharing it? |
For sure, let me just make sure I didn't do something stupid. |
Here's an example: Is it because I am doing this in separate steps? Maybe it's just worth a |
Sorry, got pulled away from this but taking another look.
No, that's what you should be doing. Everything you're doing looks right to me. FWIW I think this issue is only manifesting with mac - https://github.com/damccorm/actions-playground/pull/3/checks?check_run_id=204886256. Wondering if its related to one of these issues - https://stackoverflow.com/questions/49661521/how-to-update-npm-on-macos... |
If there was a setup-npm or npm-version input, it would just run the command above that appears to be failing on the mac for some reason. Steps do run out of process but it should be fine since that should change symlinks. We don't have an npm-version property since (1) installing a node version by querying their json, happens to carry a version of npm and (2) if the version specified is different then it would just do npm -i npm@ver (so why not just do that)? So I think the action item is to figure out why npm -i is not working on the mac image. |
Hello everyone. Sorry for the late response. I've tried to reproduce the issue, but it looks like nodejs version setting up by the action works as expected. If you use nodejs version from hosted images you can try to upgrade npm version with this command: For now I'm closing the issue. We have similar issue with adding npm-version input. If you have any concerns feel free to contact us. |
It would be cool to optionally specify which version of npm is used regardless of the node version (use case: I am using AWS Lambda with the 8.10 runtime, but I want to use npm@6.7.0)
The text was updated successfully, but these errors were encountered: