I am developing a TypeScript project on macos and it successfully compiles (tsc) locally but when the following github actions script is run:
build:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'npm'
- run: npm ci
- run: npm run compile
it fails with the output:
Run npm run compile
> hello_world@1.0.0 compile
> tsc
Error: src/common/validation.ts(1,3[4](https://github.com/{redacted}/job/17324159764#step:6:5)): error TS230[7](https://github.com/{redacted}/job/17324159764#step:6:8): Cannot find module 'Ajv' or its corresponding type declarations.
Error: Process completed with exit code 2.
I have tried switching the runner os to 'macos-latest' to match my local environment but it gives the same result. The only thing I can think of is something I have installed locally that the runner needs but 'ajv' is in the list of dependencies so it should be installed by the 'npm ci' step of the githb action script. Any help is greatly appreciated!
Expected behavior
github actions runner succeeds just like running the script locally.
Steps to reproduce the issue
run the above github actions script with a TypeScript project that has ajv as a dependency
Current behavior
I am developing a TypeScript project on macos and it successfully compiles (tsc) locally but when the following github actions script is run:
it fails with the output:
(* I 'redacted' my project info)
my package.json:
I have tried switching the runner os to 'macos-latest' to match my local environment but it gives the same result. The only thing I can think of is something I have installed locally that the runner needs but 'ajv' is in the list of dependencies so it should be installed by the 'npm ci' step of the githb action script. Any help is greatly appreciated!
Expected behavior
github actions runner succeeds just like running the script locally.
Steps to reproduce the issue
Environment