npm / npm

This repository is moving to: https://github.com/npm/cli
http://npm.community
17.54k stars 3.02k forks source link

Error publishing my npm package - Failed PUT 400 #15470

Closed lautsevich closed 7 years ago

lautsevich commented 7 years ago

I performed the instructions Publishing npm packages and and try to publish my test npm package at through npm Releasing (Travis CI ). However I got an error when running Travis build:

Preparing deploy
NPM version: 1.4.28
Authenticated with email account@lovata.com
dpl.3

Deploying application
NPM API key format changed recently. If your deployment fails, check your API key in ~/.npmrc.
http://docs.travis-ci.com/user/deployment/npm/
~/.npmrc size: 50
-npm ERR! publish Failed PUT 400
npm ERR! Error: Not found : travis
npm ERR!     at RegClient.<anonymous> (/home/travis/.nvm/v0.10.36/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:308:14)
npm ERR!     at Request._callback (/home/travis/.nvm/v0.10.36/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:246:65)
npm ERR!     at Request.self.callback (/home/travis/.nvm/v0.10.36/lib/node_modules/npm/node_modules/request/request.js:236:22)
npm ERR!     at Request.emit (events.js:98:17)
npm ERR!     at Request.<anonymous> (/home/travis/.nvm/v0.10.36/lib/node_modules/npm/node_modules/request/request.js:1142:14)
npm ERR!     at Request.emit (events.js:117:20)
npm ERR!     at IncomingMessage.<anonymous> (/home/travis/.nvm/v0.10.36/lib/node_modules/npm/node_modules/request/request.js:1096:12)
npm ERR!     at IncomingMessage.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:944:16
npm ERR!     at process._tickCallback (node.js:442:13)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>
npm ERR! System Linux 4.8.12-040812-generic
npm ERR! command "/home/travis/.nvm/v0.10.36/bin/node" "/home/travis/.nvm/v0.10.36/bin/npm" "publish"
npm ERR! cwd /home/travis/build/lovata/travis
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/travis/build/lovata/travis/npm-debug.log
npm ERR! not ok code 0
Done. Your build exited with 0.

The full build job log you can find there and build tasks there.

What do i wrong? Thank you!

kenany commented 7 years ago

@lautsevich Does this also occur with newer versions of npm?

lautsevich commented 7 years ago

I don't know. I used only the common configuration of Travis.

kenany commented 7 years ago

@lautsevich Please at least try updating:

before_install:
  - npm install -g npm
  - npm --version
lautsevich commented 7 years ago

@KenanY, thx! I moved forward. But I have new troubles now:

Deploying application
NPM API key format changed recently. If your deployment fails, check your API key in ~/.npmrc.
http://docs.travis-ci.com/user/deployment/npm/
~/.npmrc size: 48
npm WARN npm npm does not support Node.js v0.10.36
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! publish Failed PUT 403
npm ERR! Linux 4.8.12-040812-generic
npm ERR! argv "node" "/home/travis/.nvm/v0.10.36/bin/npm" "publish"
npm ERR! node v0.10.36
npm ERR! npm  v4.1.1
npm ERR! code E403
npm ERR! you do not have permission to publish "travis". Are you logged in as the correct user? : travis
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /home/travis/build/lovata/travis/npm-debug.log
Done. Your build exited with 0.

Then I've added following lines to my Travis config:

sudo: required
before_install:
    - sudo apt-get update
    - sudo apt-get install nodejs

I moved even further. And I've got a new problem:

Deploying application
NPM API key format changed recently. If your deployment fails, check your API key in ~/.npmrc.
http://docs.travis-ci.com/user/deployment/npm/
~/.npmrc size: 48
npm ERR! publish Failed PUT 403
npm ERR! Linux 4.4.0-59-generic
npm ERR! argv "/home/travis/.nvm/versions/node/v7.4.0/bin/node" "/home/travis/.nvm/versions/node/v7.4.0/bin/npm" "publish"
npm ERR! node v7.4.0
npm ERR! npm  v4.1.1
npm ERR! code E403
npm ERR! you do not have permission to publish "travis". Are you logged in as the correct user? : travis
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /home/travis/build/lovata/travis/npm-debug.log
Done. Your build exited with 0.

Then I've configured my npmjs.com credentials again but it did not solve the problem. =(

kenany commented 7 years ago

@lautsevich Are you the owner of the travis package?

lautsevich commented 7 years ago

It's just a test package and i really forgot to change credentials in package.json. I've done this and it works now. Thank you for your help!