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

trying to publish to an internal npm pipeline

Hello, 
I am trying to pipe a internal npm using pipeline for the first time

started with https://confluence.atlassian.com/bitbucket/deploy-to-npm-967317547.html

my bitbucketpipelines.yml looks like

pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- npm install
- npm run lint
- npm audit --audit-level=moderate
- export NODE_ENV=test
- npm test

branches:
master:
- step:
script: # Modify the commands below to build your repository.
- npm install
- npm run lint
- npm audit --audit-level=moderate
- export NODE_ENV=test
- npm test
- step:
name: Publish
deployment: production
script:
- npm version minor -m "Upgrade to %s [skip ci]"
- git push && git push --tags
- pipe: atlassian/npm-publish:0.2.0
variables:
NPM_TOKEN: $NPM_LOGIN_TOKEN

 I set up NPM_LOGIN_TOKEN in the pipeline variables.
I created it by npm login and then npm token create

the error my pipeline gets is


npm publish .
npm WARN invalid config registry="my-internal-registry.local"
npm WARN invalid config Must be a full url with 'http://'
npm notice
npm notice package: my-url-config@0.4.0
npm notice === Tarball Contents ===
npm notice 983B package.json
npm notice 228B .babelrc
npm notice 1.5kB .eslintrc
npm notice 884B bitbucket-pipelines.yml
npm notice 198B jasmine.json
npm notice 118B README.md
npm notice 8.1kB src/index.js
npm notice 387B src/index.test.js
npm notice === Tarball Details ===
npm notice name: my-url-config
npm notice version: 0.4.0
npm notice package size: 2.8 kB
npm notice unpacked size: 12.4 kB
npm notice shasum: 7d9bc791097a2743203cf97477e0ce33bf4fd905
npm notice integrity: sha512-H5A7AW6N/v3Y5[...]ssqmrE0Qom4oA==
npm notice total files: 8
npm notice
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-03-13T20_47_55_346Z-debug.log
✖ Failed to publish package "my-url-config@0.4.0".


Thanks for any help

1 answer

I would suspect the warning about the registry is the key pointer here, so probably if you can address that, do that first (I'm not fluent with npm so, in case this is just a warning that's given by design, ignore my comment on it).

Additionally if you add /root/.npm/_logs/ for a pipeline asset you can look into the npm debug log to get more detailed information. Maybe that helps?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,053 views 0 3
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