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 when running action: Cannot find module '@actions/core #36

Closed
eaftan opened this issue Mar 7, 2022 · 3 comments · Fixed by #57
Closed

Error when running action: Cannot find module '@actions/core #36

eaftan opened this issue Mar 7, 2022 · 3 comments · Fixed by #57

Comments

@eaftan
Copy link
Contributor

eaftan commented Mar 7, 2022

I was trying out issue-labeler at the current HEAD commit (772f647), but I get this error:

internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module '@actions/core'
Require stack:
- /home/runner/work/_actions/github/issue-labeler/[7](https://github.com/github/copilot-planning/runs/5456532223?check_suite_focus=true#step:2:7)72f6472f461fbfca5d953d5715a41db1ef5dfe4/lib/main.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:[8](https://github.com/github/copilot-planning/runs/5456532223?check_suite_focus=true#step:2:8)15:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:1[9](https://github.com/github/copilot-planning/runs/5456532223?check_suite_focus=true#step:2:9))
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/runner/work/_actions/github/issue-labeler/772f6472f461fbfca5d953d5715a41db1ef5dfe4/lib/main.js:19:27)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:[10](https://github.com/github/copilot-planning/runs/5456532223?check_suite_focus=true#step:2:10)27:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:[12](https://github.com/github/copilot-planning/runs/5456532223?check_suite_focus=true#step:2:12)) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/_actions/github/issue-labeler/772f6472f461fbfca5d953d57[15](https://github.com/github/copilot-planning/runs/5456532223?check_suite_focus=true#step:2:15)a41db1ef5dfe4/lib/main.js'
  ]
}

The problem may be that JavaScript Actions are supposed to have the node_modules directory checked in, as documented here. Note also that the doc recommends checking in package-lock.json.

I'm not sure why this worked before without the node_modules directory checked in 🤷

eaftan added a commit to eaftan/issue-labeler that referenced this issue Mar 7, 2022
As recommended by the Actions docs.

Fixes github#36
@brandonfl
Copy link

The GitHub Action is not working at all cause of this.
Did there is workaround existing ?

@stephanmiehe
Copy link
Collaborator

Please use one of the release branches rather than the head branch as each of those include the node_modules.

@brandonfl
Copy link

Please use one of the release branches rather than the head branch as each of those include the node_modules.

ok thanks for the reply, I do this then 😃

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

Successfully merging a pull request may close this issue.

3 participants