Search code examples
node.jsnpmmacos-mojave

How to enforce npm to use https node repository


Lately i've had a weird issue where a lot of my dependencies now just don' t retrieve from the https based repository anymore, i'm not sure what happened, i've checked my config, this is what is has in it:

metrics-registry = "https://registry.npmjs.com/"
registry = "https://registry.npmjs.com/"
; metrics-registry = null (overridden)
; registry = "https://registry.npmjs.org/" (overridden)

I've downgrade to a few earlier versions and still no luck, thinking that a newer version is what's causing the issue, based on what I'd read here: https://github.com/npm/npm/issues/20434

I'd like to find out why this issue is happening and if other's are having similar issue and also how do i force npm to always use SSL based registry for retrieving dependencies.


Solution

  • I solved a similar issue with:

    npm config set registry https://registry.npmjs.org/
    npm install