github / issue-labeler

An action for automatically labelling issues

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

eaftan opened this issue · comments

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 🤷

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

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

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 😃