I am using npm-publish pipe in my project's pipeline. The problem is that my project's prepublishOnly script requires Node v14 while the npm-publish pipe uses Node v10 (see https://bitbucket.org/atlassian/npm-publish/src/master/Dockerfile).
Does anyone know how I can use Node v14 in the npm-publish pipeline?
My bitbucket-pipelines.yml:
image: node:14.15.1
pipelines:
tags:
'v*':
- step:
name: Build and Publish
deployment: production
script:
- npm config set unsafe-perm true
- npm install webpack@5.4.0 webpack-cli@4.6.0 -g
- npm install
- pipe: atlassian/npm-publish:0.3.2
variables:
NPM_TOKEN: $NPM_TOKEN
EXTRA_ARGS: "--dry-run --unsafe-perm"
Relevant error in my pipeline log:
<span>Status: Downloaded newer image for bitbucketpipelines/npm-publish:0.3.2<br></span><span>INFO: Starting pipe execution...<br></span><span>INFO: Registry URL: <a href="https://registry.npmjs.org/" target="_blank" rel="noopener nofollow noreferrer">https://registry.npmjs.org<br></a></span><span>INFO: Setting npm auth configuration...<br></span><span>INFO: Publishing package...</span><span>npm publish . --dry-run --unsafe-perm<br><br></span><span>> chesapeake-progress-charts@1.1.1 prepublishOnly .<br></span><span>> NODE_ENV=production webpack --config=./webpack.module-build.config.js<br><br></span><span>[webpack-cli] Failed to load '/opt/atlassian/pipelines/agent/build/webpack.module-build.config.js' config<br></span><span>[webpack-cli] Error: Missing binding /opt/atlassian/pipelines/agent/build/node_modules/node-sass/vendor/linux_musl-x64-64/binding.node<br></span><span>Node Sass could not find a binding for your current environment: Linux/musl 64-bit with Node.js 10.x<br><br></span><span>Found bindings for the following environments:<br></span><span> - Linux 64-bit with Node.js 14.x<br><br></span><span>This usually happens because your environment has changed since running `npm install`.</span>
package.json
"prepublishOnly": "NODE_ENV=production webpack --config=webpack.module-build.config.js"