My build started to fail with the latest version of the nodejs docker image (circleci/node:latest). I didn’t change anything in the config or anywhere:
version: 2
jobs:
build:
docker:
- image: 'circleci/node:latest'
steps:
- checkout
- run:
name: install
command: npm ci
- run:
name: commitlint
command: npx --no-install commitlint-circle
- run:
name: lint
command: npm run lint
- run:
name: test
command: npm run test
- run:
name: build
command: npm run build
- run:
name: release
command: npx --no-install semantic-release
This is my config file, The issue happens because I generate a folder during installation phase (postinstall) and for some reason the folder is not available anymore for the following steps
Do i do something bad, or is there a problem with the image ? I did this for quite a long time and I never had any issues until now.
Hi @Nebulis! Thanks for your patience. I didn’t see any other reports about this image not working recently, but let me dig and make sure. Is the build still failing, and if so, is there a specific error?
src/index.ts:1:26 - error TS2307: Cannot find module './__generated__/sg/gov/tech/geekout/1.0/schema' or its corresponding type declarations.
1 import * as geekout from "./__generated__/sg/gov/tech/geekout/1.0/schema";
The reason is that the generated code after npm install is not available. I downgraded to circleci/node:14.13.1 and it works well.
One thing to keep in mind is that even if you don’t change anything, if you’re using the latest tag, the image pulls its version from upstream (Docker). It will update to the latest version released, and it looks like 15.x just released a few days ago.
I didn’t consider node 15 indeed. I checked the install phase and I noticed that for node 15 images, postinstall is not run which explain the issue.
npm ci on node 14 image:
#!/bin/bash -eo pipefail
npm ci
> core-js@2.6.11 postinstall /home/circleci/project/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> fsevents@1.2.13 install /home/circleci/project/node_modules/fsevents
> node install.js
Skipping 'fsevents' build as platform linux is not supported
> @govtechsg/oa-schemata@0.0.0-development postinstall /home/circleci/project
> node scripts/post-install
Creating types from src/sg/gov/tech/geekout/1.0/schema.json
Creating types from src/sg/gov/moh/healthcert/1.0/schema.json
added 1212 packages in 20.498s
CircleCI received exit code 0
npm ci on node 15 image:
npm ci
[ .........] / <LOGS THAT I REMOVED>
added 1212 packages, and audited 1645 packages in 28s
1 package is looking for funding
run `npm fund` for details
30 vulnerabilities (22 low, 8 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
CircleCI received exit code 0