自从上次在Vmware中成功安装Manjaro, 我感觉用来作为敲代码的环境还是非常舒服的.
但今天在尝试在Linux下使用NPM创建Angular项目的时候, 出现了问题 - 无法改变默认的npm的默认registry.
经过我的实验, 单纯使用
npm config set registry <https://registry.npm.taobao.org>
是无法起到彻底更改registry的效果的. 即便之后执行命令
npm config get registry
时显示registry为你设置的源.
正确姿势:
在shell中执行npm命令, 有如下结果
[zrh-vmwarevirtualplatform ~]# npm
npm <command>
Usage:
npm install install all the dependencies in your project
npm install <foo> add the <foo> dependency to your project
npm test run this project's tests
npm run <foo> run the script named <foo>
npm <command> -h quick help on <command>
npm -l display usage info for all commands
npm help <term> search for help on <term>
npm help npm more involved overview
All commands:
access, adduser, audit, bin, bugs,