From d19b844357ed0c32194bfc823ac98e50f1a74a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sope=C3=B1a=20Merino?= Date: Thu, 7 Jul 2022 06:14:58 +0200 Subject: [PATCH] BUGFIX. Wrong 'node' and 'deploy' workflows when using node versions >14 Error: - In the `node` workflow, the `npm ci` command does not work, it needs the `package-lock.json` file to work, but this file is removed by the npm `preinstall` script. Solution: - Use in workflows the `npm install` command instead of `npm ci`. The `npm install` automatically runs the npm `preinstall` script which already does a clean install, removing the `node_modules` folder and the `package-lock.json` file. - Use `node` version 14 for the project, the following versions still do not work. References: - npm-force-resolutions not working when installing a new package https://stackoverflow.com/a/68095189/10855837 - What is the difference between "npm install" and "npm ci"? https://stackoverflow.com/a/53325242/10855837 - Npm install fails in npm-force-resolutions if there is a space in the user folder https://github.com/rogeriochaves/npm-force-resolutions/issues/17 - NPM force-resolutions https://www.npmjs.com/package/force-resolutions --- .github/workflows/node.js.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 16876aad..7dae8862 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,14 +16,14 @@ jobs: strategy: matrix: - node-version: [14.x, 16.x] + node-version: [14.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - run: npm ci + - run: npm install - run: npm run build --if-present - run: npm test --if-present