Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to publish npm package to public nexus repository

Pranshu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 17, 2023

Please find the configured pipeline below


tags
:
'*':
- step:
name: Init
caches:
- node
script:
- npm config set @apollo247:registry=<Registry>
- npm config set _auth=$NPM_TOKEN
- npm install
- pipe: atlassian/npm-publish:1.0.0
variables:
NPM_TOKEN: $NPM_TOKEN
DEBUG: 'true'
NPM_REGISTRY_AUTH_URL: <Registry>

 

 

 

Find Error below from the pipeline

npm notice
740
npm verb stack Error: This command requires you to be logged in to $NPM_REGISTRY
741
npm verb stack at Publish.exec (/usr/local/lib/node_modules/npm/lib/commands/publish.js:110:29)
742
npm verb stack at async module.exports (/usr/local/lib/node_modules/npm/lib/cli-entry.js:61:5)
743
npm verb cwd /opt/atlassian/pipelines/agent/build
744
npm verb Linux 5.15.0-1044-aws
745
npm verb node v18.18.0
746
npm verb npm v9.8.1
747
npm ERR! code ENEEDAUTH
748
npm ERR! need auth This command requires you to be logged in to $NPM_REGISTRY
749
npm ERR! need auth You need to authorize this machine using `npm adduser`
750
npm verb exit 1
751
npm verb code 1
752
753
npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-10-17T08_46_19_082Z-debug-0.log
754
+ status=1
755
+ set -e
756
+ [[ 1 -eq 0 ]]
757
+ fail 'Failed to publish package "@apollo247/pharma-cart-sevice@1.0.0-alpha16".'
758
+ echo -e '\e[31m✖ Failed to publish package "@apollo247/pharma-cart-sevice@1.0.0-alpha16".\e[0m'
759
+ exit 1

2 answers

1 accepted

0 votes
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 20, 2023

@Pranshu hi. Please, check this article.

 

Regards, Igor

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 18, 2023

Hi Pranshu and welcome to the community!

The README of the pipe's repo mentions the following:

By default, the pipe publishes to npmjs.com. You can publish to any other registry by adding a publishConfig.registry key in your package.json. See npm documentation for more details.

Are you publishing to a registry other than https://npmjs.com/? If so, have you configured the publishConfig.registry key in your package.json?

Kind regards,
Theodora

Pranshu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 18, 2023

Yes, I'm publishing to a registry other than npmjs and some had been configured in publishConfig.registry key 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events