Recently, I have been attempting to follow a tutorial on creating custom GitHub actions using JavaScript from here. The tutorial suggests using the @vercel/ncc package to compile code into a single file if you prefer not to check in your node_modules folder. Despite trying the NCC sample provided here, I consistently encounter an error that seems unresolvable.
Error: Cannot find module 'C:\Projects\github-runner-test\.github\actions\read-deploy-instructions\index.js'
Require stack:
- C:\Projects\github-runner-test\.github\actions\read-deploy-instructions\node_modules\@vercel\ncc\dist\ncc\cli.js
...
I have experimented with different approaches including utilizing both bash and powershell, rearranging directories, and adjusting configurations with no success. My current project structure is as depicted https://i.sstatic.net/AWpV1.png.
The contents of my package.json are:
{
"name": "read-deploy-instructions",
"version": "1.0.0",
...
}
And here is a snippet from my index.js file:
import core from '@actions/core';
import github from '@actions/github';
try {
...
}
Running the command npm run build results in the aforementioned error. It appears that similar issues have been faced by others without any clear solutions. Any suggestions or insights would be greatly appreciated!
Thanks,