0

I tried to publish in registry.npmjs.org/ with gitlab ci, but instead of publish, i get an error

I tried what this page says https://webbureaucrat.gitlab.io/posts/continuously-deploying-an-npm-package-with-gitlab-ci-cd/

with this gitlab-ci.yml file

image: node:latest
stages:
    - deploy

deploy:
  stage: deploy
  script:
      - echo "//registry.npmjs.org/:_authToken=${NPMJS_TOKEN}" > .npmrc
      - npm publish

But I get the next error

npm notice
npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in to https://registry.npmjs.org/
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:\

I tried to change by this but I have the same output

- npm config set //registry.npmjs.org/:_authToken ${NPMJS_TOKEN}

I thought I would fixed something when i did this because the error message changes

- npm config set //registry.npmjs.org/:_authToken ${NPMJS_TOKEN}
npm notice 
npm notice Publishing to https://registry.npmjs.org/
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/xxxx - Not found
npm ERR! 404 
npm ERR! 404  'xxxx@1.0.0' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:

But I couldn't go any further than here, the funny thing is if i go to this link https://registry.npmjs.org/xxxx after i published local, this results something by HTTP get by browser, but still show the same message, even if I increase the version

The only way i can have same error doing a local publish was doing npm publish after i delete the package, i had to change the package name to publish again (this doesn't work in gitlab)

Martin ad
  • 1
  • 1

0 Answers0