nrm是一个npm源管理工具,利用它我们可以快速切换npm源,利用nrm还可以测试哪个源最快。如果哪个npm依赖安装失败,不防切换一下npm源试试
npm install nrm -g
输入nrm
,enter后可调出help或nrm help
D:\project>nrm
Usage: cli [options] [command]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
ls List all the registries
current Show current registry name
use <registry> Change registry to registry
add <registry> <url> [home] Add one custom registry
del <registry> Delete one custom registry
home <registry> [browser] Open the homepage of registry with optional browser
test [registry] Show response time for specific or all registries
help Print this help
nrm ls
列出源列表,前面带*
号的表示当前在使用
D:\project>nrm ls
npm ---- https://registry.npmjs.org/
* cnpm --- http://r.cnpmjs.org/
taobao - https://registry.npm.taobao.org/
nj ----- https://registry.nodejitsu.com/
rednpm - http://registry.mirror.cqupt.edu.cn/
npmMirror https://skimdb.npmjs.com/registry/
edunpm - http://registry.enpmjs.org/
nrm current
显示当前使用源
D:\project>nrm current
cnpm
nrm use
切换源,如下,切换到npm官方源
D:\project>nrm use npm
Registry has been set to: https://registry.npmjs.org/
D:\project>nrm ls
* npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
taobao - https://registry.npm.taobao.org/
nj ----- https://registry.nodejitsu.com/
rednpm - http://registry.mirror.cqupt.edu.cn/
npmMirror https://skimdb.npmjs.com/registry/
edunpm - http://registry.enpmjs.org/
其他命令自己去试吧
internal/validators.js:124 throw new ERR_INVALID_ARG_TYPE(name, ‘string‘, value)
如何在VUE项目中添加stylelint,检查css,scss,less的语法问题,保证团队代码的规范统一
npm ERR! Cannot read property &amp;#39;match&amp;#39; of undefined
nodejs 社区乃至 Web 前端工程化领域发展到今天,作为 node 自带的包管理工具的 npm 已经成为每个前端开发者必备的工具。但是现实状况是,我们很多人对这个nodejs基础设施的使用和了解还停留在: 会用 npm install 这里(一言不合就删除整个 node_modules 目录然后重新 install 这种事你没做过吗?)
如何发布一个npm模块到npmjs.com
nrm是一个npm源管理工具,利用它我们可以快速切换npm源,利用nrm还可以测试哪个源最快。如果哪个npm依赖安装失败,不防切换一下npm源试试
npm 教程
阮一峰老师的package.json文件详解