Install npm modules automatically for node actions
See original GitHub issueCurrently, if the node_modules aren’t included in the repo, the action will fail on require('@actions/core').
This probably should be dealt with on the platform level, but in the mean time, node_modules shouldn’t be excluded in the .gitignore.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
How To Use Node.js Modules with npm and package.json
When you first install a package to a Node.js project, npm automatically creates the node_modules folder to store the modules needed for ...
Read more >actions/setup-node - GitHub
Supported package managers are npm , yarn , pnpm (v6.10+). The cache input is optional, and caching is turned off by default. The...
Read more >npm-install - npm Docs
This command installs a package, and any packages that it depends on. If the package has a package-lock or shrinkwrap file, the installation...
Read more >Github actions how to do npm install only 1 time - Stack Overflow
I'm using GitHub actions for deploy. And i need to build vuejs app, every time when pushing. Now all working coorectly, but every...
Read more >OpenWhisk Action Running “npm install” for You | by Priti Desai
The NPM modules which are installed once by build/nodejs are available for later use by any other Node.js actions. This reduces action creation...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You’re referencing master which is the coding branch. You should reference a distribution branch. The distribution branch contains a fully self contained set of code.
https://github.com/actions/toolkit/blob/master/docs/action-versioning.md
This template and walkthrough has you checking in production dependencies.
The runner downloads the files at the location and ref and runs it. That’s it.
In the example above ^^ you’re referencing master which is the coding branch and doesn’t have production runtime dependencies.
npm install is a dev build time action. distributions are self contained.
covered in readme walthrough: https://github.com/actions/javascript-action#publish-to-a-distribution-branch
I will write up a public document soon on the toolkit repo with the GPR proposal which we will start soon …