Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is NPM's npm config set always-auth not a valid option? NPM 8+

Tags:

npm

travis-ci

Specifically -> 'npm config set always-auth true' in my travis.yml file under before_install: section gives the error in Travis: "npm ERR! always-auth is not a valid npm option"

I have tried the following variations.

npm config set always-auth true
npm config set always-auth=true
npm config set registry:always-auth true    // I set the registry beforehand
npm config set registry:always-auth=true

Each of these gave the same error in travis.

like image 250
Ethan Avatar asked Dec 18 '25 09:12

Ethan


1 Answers

It looks like npm deprecated this config setting for versions higher than 6. Based on the changelog provided above it looks like --always-auth was unused and incorrectly documented.

I stumbled upon this problem with Azure Pipeline as it appears Microsoft had updated their virtual machines to Node 19 and npm 8.

The more concerning change in higher versions of npm (v9 and above) is that addUser actually creates a new user now, before it was behaving as login. This distinction between what login and addUser do with npm 9, was fixed by simply adjust my commands to the new behaviors.

like image 153
Zdravko Kolev Avatar answered Dec 22 '25 10:12

Zdravko Kolev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!