I have the following line in my dependencies in package.json:
"log": "",I get the following:
km@Karls-MBP ~/dev/vertica (km/ref) $ npm install
npm ERR! code E401
npm ERR! 404 401 Unauthorized: log@
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/km/.npm/_logs/2018-02-16T08_49_38_669Y-debug.logI don't know if the issue is GitLab (where the repo exists) or NPM.
- Node v8.9.4
- NPM v5.6.0
8 Answers
Remove .npmrc from the Home Directory, it should be able to work. I did the same and it works for me.
2My user directory .npmrc file had a stale authtoken as below.
//
By removing this line, the npm installation works fine and no longer throws an authentication error.
0You need to add user to npm registery
>> npm whoami [ it will return not authorized ]To add new user follow below steps :-
>> npm adduser (then enter your name and complex password and your email)
>> npm whoami (return your registered name) I got this when I used --prefer-offline
- npm ci --cache .npm --prefer-offline --unsafe-perm --no-optionalRemoving that option fixed it.
In my case I have to change the content of .npmrc file to package-lock=false.
Now it works fine!
removing the .npmrc from the root directory worked for me
I got the same error but the reason in my case was different than the above answers:
I discovered that the package-lock.json had some of the packages resolved to a private url instead of the typical public npm urls, so deleting the npm lock file and running npm install again solved it
But if this is the case, you need to check with the team still why this private url resolution happened instead of the normal one
I noticed this error for a public github repo. Removed the entry always-auth = true and was able to proceed.