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

前端 未结 10 1457
自闭症患者
自闭症患者 2020-12-12 10:08

I create a.bat on windows 7, the content of a.bat is:

@echo off
npm config set registry https://registry.npmjs.org/

and then run a.bat, but

相关标签:
10条回答
  • 2020-12-12 10:40
    2.name can no longer contain capital letters
    

    don't use capital letters for your package:

    npm install --save uex
    

    use this:

    npm install --save vuex
    
    0 讨论(0)
  • 2020-12-12 10:41

    On version 4.4.1, you can use:

    npm config set @myco:registry=http://reg.example.com
    

    Where @myco is your package scope. You can install package in this way:

    npm install @myco/my-package
    

    ref: https://docs.npmjs.com/misc/scope

    0 讨论(0)
  • 2020-12-12 10:42

    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/ 
    
    0 讨论(0)
  • 2020-12-12 10:42

    You can change using the .bat make sure you run the call command prior, hopefully this helps anyone in future making similar .bat commands

    call npm config set registry https://registry.npmjs.org/
    
    0 讨论(0)
提交回复
热议问题