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

Error: Cannot find module '@actions/core' #5

Closed
Biont opened this issue Nov 28, 2019 · 7 comments
Closed

Error: Cannot find module '@actions/core' #5

Biont opened this issue Nov 28, 2019 · 7 comments
Assignees

Comments

@Biont
Copy link

Biont commented Nov 28, 2019

Granted, this is the first time I'm trying out Github Actions and I could well be doing things wrong entirely. But while I could use and run a shellcheck action from another repo successfully, this action here fails with the above error.
Full log output here:

2019-11-28T22:03:30.1313172Z ##[section]Starting: Request a runner to run this job
2019-11-28T22:03:30.3575929Z Requesting a hosted runner in current repository's account/organization with labels: 'ubuntu-latest', require runner match: True
2019-11-28T22:03:30.6525947Z Labels matched hosted runners has been found, waiting for one of them get assigned for this job.
2019-11-28T22:03:30.7514875Z ##[section]Finishing: Request a runner to run this job
2019-11-28T22:03:39.5813125Z Current runner version: '2.161.0'
2019-11-28T22:03:39.5814332Z Prepare workflow directory
2019-11-28T22:03:39.6024050Z Prepare all required actions
2019-11-28T22:03:39.6051476Z Download action repository 'mig4/setup-bats@master'
2019-11-28T22:03:41.8063239Z Download action repository 'actions/checkout@v1'
2019-11-28T22:03:42.0128588Z ##[group]Run mig4/setup-bats@master
2019-11-28T22:03:42.0129010Z with:
2019-11-28T22:03:42.0129260Z   bats-version: 1.1.0
2019-11-28T22:03:42.0129388Z ##[endgroup]
2019-11-28T22:03:42.3464864Z internal/modules/cjs/loader.js:626
2019-11-28T22:03:42.3465088Z     throw err;
2019-11-28T22:03:42.3465237Z     ^
2019-11-28T22:03:42.3465313Z 
2019-11-28T22:03:42.3466136Z Error: Cannot find module '@actions/core'
2019-11-28T22:03:42.3466306Z Require stack:
2019-11-28T22:03:42.3466701Z - /home/runner/work/_actions/mig4/setup-bats/master/lib/setup-bats.js
2019-11-28T22:03:42.3466887Z     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15)
2019-11-28T22:03:42.3467096Z     at Function.Module._load (internal/modules/cjs/loader.js:527:27)
2019-11-28T22:03:42.3467263Z     at Module.require (internal/modules/cjs/loader.js:681:19)
2019-11-28T22:03:42.3467423Z     at require (internal/modules/cjs/helpers.js:16:16)
2019-11-28T22:03:42.3467892Z     at Object.<anonymous> (/home/runner/work/_actions/mig4/setup-bats/master/lib/setup-bats.js:18:27)
2019-11-28T22:03:42.3468078Z     at Module._compile (internal/modules/cjs/loader.js:774:30)
2019-11-28T22:03:42.3468243Z     at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
2019-11-28T22:03:42.3468411Z     at Module.load (internal/modules/cjs/loader.js:641:32)
2019-11-28T22:03:42.3468555Z     at Function.Module._load (internal/modules/cjs/loader.js:556:12)
2019-11-28T22:03:42.3468719Z     at Function.Module.runMain (internal/modules/cjs/loader.js:837:10) {
2019-11-28T22:03:42.3469081Z   code: 'MODULE_NOT_FOUND',
2019-11-28T22:03:42.3489216Z   requireStack: [
2019-11-28T22:03:42.3489845Z     '/home/runner/work/_actions/mig4/setup-bats/master/lib/setup-bats.js'
2019-11-28T22:03:42.3490037Z   ]
2019-11-28T22:03:42.3490182Z }
2019-11-28T22:03:42.3501078Z ##[error]Node run failed with exit code 1
2019-11-28T22:03:42.3544191Z Cleaning up orphan processes

Please let me know if I can provide more information to help solve this. And thanks for creating this action.

@jhc-explore
Copy link

I have the same issue.

@vanosg
Copy link

vanosg commented Jan 28, 2020

I hate 'me too' posts, but... me too. Thanks for the time and effort to put this together in the first place!

@jhc-explore
Copy link

@vanosg I got around the issue by just doing this (you'll have to put proper path to your .bats file of course):

    - name: Setting up BATS
      run: sudo npm install -g bats
    - name: Running tests
      run: bats -t tests.bats

jeremyhuiskamp added a commit to jeremyhuiskamp/utils that referenced this issue May 15, 2020
asbjornu added a commit to SwedbankPay/git-directory-deploy that referenced this issue May 18, 2020
Replace `mig4/setup-bats` with manual `npm install` due to the following bug:

mig4/setup-bats#5
@asbjornu
Copy link

Same problem here. Running sudo npm install -g bats instead fixed it.

sengaya added a commit to sengaya/aws-micro-cli that referenced this issue May 23, 2020
joshuaspence added a commit to joshuaspence/kubernetes-json-schema that referenced this issue Sep 3, 2020
joshuaspence added a commit to joshuaspence/kubernetes-json-schema that referenced this issue Sep 3, 2020
@mig4
Copy link
Owner

mig4 commented Sep 13, 2020

Apologies for this slipping by unnoticed for a while.

So this is because I followed GitHub Actions documentation which, at least at that time, suggested discouraging users from using master branch and in fact suggested not to include built code in master branch therefore preventing its use entirely.

TL;DR should be OK if you use the release branch: uses: mig4/setup-bats@v1

But I've just noticed that in the marketplace it shows the README from master which shows a bad example. So I recon at the least I should update docs, but I'll check with actions docs to see if the recommendations have changed.

@mig4
Copy link
Owner

mig4 commented Sep 13, 2020

Right so the upstream action template has changed and now uses ncc and now does include build artifacts in master. I'll update to follow that template. The recommendation to only use releases stands, so mig4/setup-bats@v1.

mig4 added a commit that referenced this issue Oct 31, 2020
Since marketplace shows README from the master branch, change it to
suggest using the latest release. Using master directly is not supported
and in fact doesn't work in current form.

Also, Actions are now out of beta so remove the warning.

Towards #5
@mig4 mig4 self-assigned this Nov 1, 2020
@mig4
Copy link
Owner

mig4 commented Nov 1, 2020

This is fixed now, I updated the README in the master branch so instructions shown on marketplace page recommend using v1 tag, but I also finished refactoring based on the new scaffolding in typescript-action template and released v1.2.0 which should allow using @master as well.

Holla if there's still issues with this, and many thanks for reporting @Biont ❤️

@mig4 mig4 closed this as completed Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants