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

前端 未结 10 1488
自闭症患者
自闭症患者 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:30

    You shouldn't change the npm registry using .bat files. Instead try to use modify the .npmrc file which is the configuration for npm. The correct command for changing registry is

    npm config set registry

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

提交回复
热议问题