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
Set npm registry globally
use the below command to modify the .npmrc config file for the logged in user
npm config set registry
Example: npm config set registry https://registry.npmjs.org/
Set npm registry Scope
Scopes allow grouping of related packages together. Scoped packages will be installed in a sub-folder under node_modules folder.
Example: node_modules/@my-org/packagaename
To set the scope registry use: npm config set @my-org:registry http://example.reg-org.com
To install packages using scope use: npm install @my-org/mypackage
whenever you install any packages from scope @my-org npm will search in the registry setting linked to scope @my-org for the registry url.
Set npm registry locally for a project
To modify the npm registry only for the current project. create a file inside the root folder of the project as .npmrc
Add the below contents in the file
registry = 'https://registry.npmjs.org/'