mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #2384] Local Actions - Error: Cannot find module - MODULE_NOT_FOUND #1098
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#1098
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @smashedr on GitHub (Jul 4, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2384
Bug report info
Command used with act
Describe issue
All my local actions started throwing this error (based on the respective local action being used):
Error: Cannot find module '/home/shane/docker/test2/parse-issue-form-action/dist/index.js'But the file is clearly there:
action.yml
This was previously working working just fine. I setup an all new test to make sure it was not something with my environment, but got the exact same error. This is the sample test I setup:
Note: Previously I place all my local actions in the
./.githubfolder, example:.github/parse-issue-form-actionI have tried this new test in both the
./.githubdirectory and current working directory, but both throw the same error.Additionally, I was also previously able to run my actions from source, by setting my main in action.yml to
src/index.jswith anode_modulesin the current working directory, but doing that also fails with the errorError: Cannot find module '@actions/core'whennpm lsclearly shows it installed.Again, all this was previously working, just days ago, and now all fails. Did something change?
Link to GitHub repository
No response
Workflow content
Relevant log output
Additional information
The
index.jshas was reduced to just this for the test:@smashedr commented on GitHub (Jul 4, 2024):
I was so confused why something that worked just days ago, stopped working today, I did more digging. The only thing I could find that changed locally from before/after was an apt upgrade. This is the log from that upgrade if useful:
@noesterle commented on GitHub (Aug 24, 2024):
I believe I am running into a similar issue. I can get all packages and build the project locally, however
actis running into aMODULE_NOT_FOUNDerror with a module I can retrieve, have installed, and can use.package.json
Workflow YAML
@smashedr commented on GitHub (Aug 24, 2024):
@noesterle
Make sure you don't have your node_modules in your .gitignore or use
--use-gitignore=falseI added more information about this here: https://github.com/smashedr/js-test-action
@noesterle commented on GitHub (Sep 1, 2024):
Using
--use-gitignore=falseworked for me, thank you!I didn't have node_modules in my .gitignore, the only thing that was in there was where the build output is put. If
actrespecting the .gitignore meant that directory couldn't be created/seen, that must have triggered the same message.@github-actions[bot] commented on GitHub (Mar 1, 2025):
Issue is stale and will be closed in 14 days unless there is new activity