Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Use a different Node version in npm-publish pipe

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:

Status: Downloaded newer image for bitbucketpipelines/npm-publish:0.3.2
INFO: Starting pipe execution...
INFO: Registry URL: https://registry.npmjs.org
INFO: Setting npm auth configuration...
INFO: Publishing package...npm publish . --dry-run --unsafe-perm

> chesapeake-progress-charts@1.1.1 prepublishOnly .
> NODE_ENV=production webpack --config=./webpack.module-build.config.js

[webpack-cli] Failed to load '/opt/atlassian/pipelines/agent/build/webpack.module-build.config.js' config
[webpack-cli] Error: Missing binding /opt/atlassian/pipelines/agent/build/node_modules/node-sass/vendor/linux_musl-x64-64/binding.node
Node Sass could not find a binding for your current environment: Linux/musl 64-bit with Node.js 10.x

Found bindings for the following environments:
- Linux 64-bit with Node.js 14.x

This usually happens because your environment has changed since running `npm install`.
 

 

package.json

"prepublishOnly": "NODE_ENV=production webpack --config=webpack.module-build.config.js"

 

1 answer

The npm publish pipe is basically a thin shell script wrapping the npm publish command.

As you're already building in the pipeline script, why not drop the pipe and run npm publish directly in your already fitting pipeline container?

Just an idea.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Security Advisory for Jira Service Management

On October 20, 2021, Atlassian published a security advisory for Jira Service Management. The full advisory is available at this link.  We've seen a number of questions already asking for...

76 views 0 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you