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

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

    By executing your .bat you are setting config for only that session not globally. When you open and another cmd prompt and run npm install that config will not set for this session so modify your .bat file as

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

提交回复
热议问题