Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 4

JS Action: Cannot find module

Solved! Go to Solution.

I was going through this Github lab and was at stage "Having Actions tell a joke... or two". 

After completing the Action, I realized that Action Two doesn't run. The error message was



Error: Cannot find module 'request-promise'



I assumed that any dependencies would be automatically installed when action.yml specified running a "nodeX". actions/core seems to be working well for Action One though. Just curious as to why is this happening.


Thank you.

3 Replies
Community Manager
Message 2 of 4

Re: JS Action: Cannot find module

Hi @ShaunLWM,


This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our community organized so users can more easily find information.


As you’ll notice, your topic is now here in the GitHub learning lab board. No action is needed on your part; you can continue the conversation as normal here.



My very best,

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Copilot Lvl 3
Message 3 of 4

Re: JS Action: Cannot find module

@ShaunLWM Thanks for bringing this to our attention.  

I took a quick look at your repository and didn't see any node_modules for the joke action.  Although we don't typically commit node_modules to a repository, for the purposes of this course you will need to do so.

The request and request-promise libraries are install locally when you run npm install request request-promise in a preivous instruction.  I see that this step was completed properly since your package.json contains those dependencies. 


The workflow does not run any sort of npm install which is why you need to commit the node_modules, your package.json will never be read by the environment during the duration of this course.

Copilot Lvl 3
Message 4 of 4

Re: JS Action: Cannot find module

Ah, alright that was a mind fart moment right there. No wonder it stopped working as soon as I added the .gitignore files for the node_modules folder.


Thank you so much, and have a nice week ahead :)