Skip to content

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

Description

@eaftan

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 🤷

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions