GithubHelp home page GithubHelp logo

Comments (35)

AnandWalvekar avatar AnandWalvekar commented on May 18, 2024 114

It go resolved!!!

  1. Switch to Login module (by typing "how-to-npm" on command line)
  2. Type "npm adduser" to login
  3. Type "npm whoami" to confirm if logged in
  4. Switch back to the package at which you are getting error(my case it was Publish Again)
  5. Type "npm publish"
  6. Done

from how-to-npm.

petermetz avatar petermetz commented on May 18, 2024 84

My issue was that I had the publishConfig object specified in package.json which defined an invalid URL (some private registry).
Had to set it up like this:

  "publishConfig": {
    "registry": "https://registry.npmjs.org/"
  },

from how-to-npm.

renatoathaydes avatar renatoathaydes commented on May 18, 2024 32

Does not work!

npm adduser
Username: xxxxxx
Password:
Email: (this IS public) [email protected]
Logged in as xxxxx on https://registry.npmjs.org/.
➜  lib1 npm publish
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`

from how-to-npm.

devhammer avatar devhammer commented on May 18, 2024 24

@AnandWalvekar That workaround didn't work for me. Still fails to publish, even when npm whomi correctly returns my username.

Getting the following output:

npm ERR! publish Failed PUT 404
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "node" "C:\\Users\\USERNAME\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "publish"
npm ERR! node v0.12.5
npm ERR! npm  v2.13.3
npm ERR! code E404

npm ERR! 404 missing : @myUser/how-to-npm
npm ERR! 404
npm ERR! 404 '@myUser/how-to-npm' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
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! Please include the following file with any support request:
npm ERR!     C:\Users\USERNAME\Documents\node_code\nodeschool.io\how-to-npm\npm-debug.log

from how-to-npm.

Carnia avatar Carnia commented on May 18, 2024 23

My issue was that I had the publishConfig object specified in package.json which defined an invalid URL (some private registry).
Had to set it up like this:

  "publishConfig": {
    "registry": "https://registry.npmjs.org/"
  },

yes, when i delete publishConfig in package.json,I can publish it normally。

from how-to-npm.

JMuhire avatar JMuhire commented on May 18, 2024 7

In my ci script, I have resolved this issue using a _auth token and setting up the user email like this :

npm config set _auth $NPM_REGISTRY_TOKEN && npm config set registry $NPM_REGISTRY_URL && npm config set always-auth=true && npm config set [email protected]

from how-to-npm.

yordis avatar yordis commented on May 18, 2024 5

I keep getting the same error even when I successfully login. npm whoam give me the correct user but it keep failing no matter what.

from how-to-npm.

alundiak avatar alundiak commented on May 18, 2024 3

@renatoathaydes

  1. What OS u have?
  2. what is ur .npmrc content or
  3. what is output of npm config list?

I see, you have https://registry.npmjs.org/ as registry, so I assume npm get registry will show it. have you tried to change to http://registry.npmjs.org/ (http).

  1. strict-ssl = false set?
  2. Are u under/behind the some proxy/vpn?

from how-to-npm.

swestcott avatar swestcott commented on May 18, 2024

Ditto, same software versions and same error.

from how-to-npm.

meppsilon avatar meppsilon commented on May 18, 2024

I'm running into this error as well. Any suggestions on how to bypass it?

from how-to-npm.

smirciat avatar smirciat commented on May 18, 2024

Same issue here. It sounds like @alabebop has a workaround, but I am too new to this environment to understand it. Is any further guidance available?

from how-to-npm.

jmanuel1 avatar jmanuel1 commented on May 18, 2024

Getting same error as @devhammer, with node v0.10.35 on Windows 10.

from how-to-npm.

quangnd avatar quangnd commented on May 18, 2024

AnandWalvekar's solution worked with me!

from how-to-npm.

davis3792 avatar davis3792 commented on May 18, 2024

The work around fixed it for me as well. Wasted a bunch of time getting there though.

from how-to-npm.

su6a12 avatar su6a12 commented on May 18, 2024

Solution worked for me as well, thanks @AnandWalvekar

from how-to-npm.

seonixx avatar seonixx commented on May 18, 2024

Workaround worked for me. Cheers @AnandWalvekar

from how-to-npm.

bennythejudge avatar bennythejudge commented on May 18, 2024

@AnandWalvekar thanks a lot it worked but I had to bump the version.
Could a skip be provided for this step?

from how-to-npm.

jondcoleman avatar jondcoleman commented on May 18, 2024

Also had this error and workaround worked for me.

from how-to-npm.

aclbros avatar aclbros commented on May 18, 2024

Workaround worked for me. Cheers @AnandWalvekar

from how-to-npm.

ashleygwilliams avatar ashleygwilliams commented on May 18, 2024

closing in favor of #46. i believe the windows problem is already doc'd in #37

from how-to-npm.

agungsantoso avatar agungsantoso commented on May 18, 2024

AnandWalvekar's solution worked with me!

from how-to-npm.

sawant avatar sawant commented on May 18, 2024

I have documented the issue and solution here #8 (comment) .

from how-to-npm.

piyushdubey avatar piyushdubey commented on May 18, 2024

@AnandWalvekar's solution worked for me as well!

from how-to-npm.

lpix avatar lpix commented on May 18, 2024

@AnandWalvekar's solution worked for me! I suggest adding this as a tip in the module in case someone has the same issue

from how-to-npm.

sudoVlad avatar sudoVlad commented on May 18, 2024

@AnandWalvekar Thanks for the solution

from how-to-npm.

swheatley avatar swheatley commented on May 18, 2024

I had to go through the steps a few times but the work around for the solution mentioned above does work :)

from how-to-npm.

sergiomgaspar avatar sergiomgaspar commented on May 18, 2024

@AnandWalvekar thx for the WA.. worked like a charm :)

from how-to-npm.

alundiak avatar alundiak commented on May 18, 2024

@AnandWalvekar solution works for me locally. but At the moment I can't figure out why the same flow doesn't work on Jenkins.
If someone has ideas, I will very thankful.

This is cut from my custom .npmrc file created by Jenkins.

; userconfig /home/builder/.jenkins/jobs/FDD test - simple project/workspace@tmp/config3550090785588839693tmp
always-auth = true
registry = "https://my-server.com:8443/repository/my-hosted-npm"
strict-ssl = false

always-auth = true means, that I provided NPM user credentials on jenkins level, and I expected Jenkins pass/substitute creds during npm publish but I can't get why it doens't work..

from how-to-npm.

renatoathaydes avatar renatoathaydes commented on May 18, 2024

OS: Linux renato 4.4.0-104-generic #127-Ubuntu SMP Mon Dec 11 12:16:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

//registry.npmjs.org/:_authToken=cef314xxxxxxx
init.author.name=Renato Athaydes
init.author.email=renatoathaydes@xxxx
➜  npm config list
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/5.6.0 node/v9.4.0 linux x64"

; userconfig /home/renato/.npmrc
init.author.email = "renatoathaydes@xxxx"
init.author.name = "Renato Athaydes"

; node bin location = /home/renato/.nvm/versions/node/v9.4.0/bin/node
; cwd = /home/renato/programming/projects/node-lib-mismatch/lib3
; HOME = /home/renato
; "npm config ls -l" to show all defaults.

I am at home, no proxies. No strict-ssl = false that I can see. And I would prefer to not use http.

from how-to-npm.

zrubing avatar zrubing commented on May 18, 2024

npm whoami is correct
I use sudo npm publish is failure,when i switch back to normal user then it worked

from how-to-npm.

Bittttter avatar Bittttter commented on May 18, 2024

I just delete currentdir/.npmrc and then use nrm use to switch npm registry. And It works.

from how-to-npm.

geoidesic avatar geoidesic commented on May 18, 2024

@Bittttter nrm use is not a thing. ?

from how-to-npm.

TylerSustare avatar TylerSustare commented on May 18, 2024

I had to go pro, publish the package, make the package public, and open a ticket to get my money back. It was super stupid.

from how-to-npm.

zuenir avatar zuenir commented on May 18, 2024

It go resolved!!!

  1. Switch to Login module (by typing "how-to-npm" on command line)
  2. Type "npm adduser" to login
  3. Type "npm whoami" to confirm if logged in
  4. Switch back to the package at which you are getting error(my case it was Publish Again)
  5. Type "npm publish"
  6. Done

Thank you, it helped to solve my problem

from how-to-npm.

sinawic avatar sinawic commented on May 18, 2024

In my ci script, I have resolved this issue using a _auth token and setting up the user email like this :

npm config set _auth $NPM_REGISTRY_TOKEN && npm config set registry $NPM_REGISTRY_URL && npm config set always-auth=true && npm config set [email protected]

@JMuhire
its 2024 and I wanna thank u for this!

i just added
registry=
_authToken=
to the .npmrc file and it workeddd

from how-to-npm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.