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' #58

Closed
aglowienka opened this issue Oct 22, 2022 · 3 comments · Fixed by #59
Closed

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

aglowienka opened this issue Oct 22, 2022 · 3 comments · Fixed by #59
Assignees
Labels
priority:critical type:bug Something isn't working

Comments

@aglowienka
Copy link

The following error started to appear when using vlaurin/action-ghcr-prune@main

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '@actions/core'
Require stack:
- /home/runner/work/_actions/vlaurin/action-ghcr-prune/main/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/runner/work/_actions/vlaurin/action-ghcr-prune/main/index.js:1:14)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:[12](https://github.com/batmaid/ops/actions/runs/3301276607/jobs/5450659847#step:2:13))
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/_actions/vlaurin/action-ghcr-prune/main/index.js'
  ]
}

Most likely, it was caused by this commit.

@vlaurin
Copy link
Owner

vlaurin commented Oct 22, 2022

Thank you for raising the issue, I'm looking into it.

In the meantime, if you haven't done so already, please switch to using a fixed version of the action:

steps:
  - uses: vlaurin/[email protected]
    ...

@vlaurin vlaurin self-assigned this Oct 22, 2022
@vlaurin vlaurin added type:bug Something isn't working priority:critical labels Oct 22, 2022
vlaurin added a commit that referenced this issue Oct 22, 2022
Resolves #58

When @vercel/ncc was introduced, the action main should have been updated to `dist/index.js` which has
all the dependencies packaged and minimised and thus doesn't rely on the presence of node_modules/
@vlaurin
Copy link
Owner

vlaurin commented Oct 22, 2022

@aglowienka Should be fixed now on main, it was straightforward to reproduce in the automated tests so I'm confident that's the correct fix. See PR #59 for the details.

@aglowienka
Copy link
Author

yep. Now everything is working fine. Thanks for quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:critical type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants