question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Install npm modules automatically for node actions

See original GitHub issue

Currently, 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:closed
  • Created 4 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
bryanmacfarlanecommented, Sep 12, 2019

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

1reaction
bryanmacfarlanecommented, Sep 12, 2019

I will write up a public document soon on the toolkit repo with the GPR proposal which we will start soon …

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found