Why “npm config set registry https://registry.npmjs.org/” is not working in windows bat file?

Why “npm config set registry https://registry.npmjs.org/” is not working in windows bat file?

Asked on October 24, 2018 in node.js.
Add Comment


  • 4 Answer(s)

    You should not change the npm registry using .bat files. If not try to use modify the .npmrc file which is the configuration for npm.

    This will be perfect command for changing registry:

    npm config set registry <registry url>

    we can find more information with npm help config command, for privileges when and if you are running .bat files this way.

    Answered on October 24, 2018.
    Add Comment

    The .bat run the call command prior, This help making similar .bat commands

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

     

    Answered on October 24, 2018.
    Add Comment

    For multiple custom registry URLs,We can run npm install with registry options

    npm install --registry=https://registry.npmjs.org/
    npm install --registry=https://custom.npm.registry.com/
    

     

    Answered on October 24, 2018.
    Add Comment

    We can also run npm install with registry options for multiple custom registry URLs.

    npm install --registry=https://registry.npmjs.org/ 
    npm install --registry=https://custom.npm.registry.com/ 
    Answered on February 21, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.