mnpm init script
Notes: mnvm
, mnpm
and myarn
are just aliases.
WARNING: the install scripts have only been tested on the lastest macOS(10.12), and should be used with cautions.
If you are using other operation systems, you may take the hard way instead.
-
Install nvm
-
Install
mnvm
curl -o- https://raw.githubusercontent.com/OpenGG/mnpm/master/install-mnvm.sh | bash
-
Install Node.js with
mnvm
mnvm install stable
-
Install
mnpm
curl -o- https://raw.githubusercontent.com/OpenGG/mnpm/master/install.sh | bash
-
(Optional) Install
myarn
curl -o- https://raw.githubusercontent.com/OpenGG/mnpm/master/install-myarn.sh | bash
-
Reload
.profile
if you don't want to init another session.source ~/.profile
mnpm
and myarn
are basically aliases for npm
and yarn
, with some extra args.
Instead of running the install scripts above, you can put the alias code into .profile
file manually.
-
Install nvm.
-
Create alias
mnvm
in.profile
fileecho "" >> ~/.profile echo 'alias mnvm="NVM_NODEJS_ORG_MIRROR=http://npm.sankuai.com/dist/node NVM_IOJS_ORG_MIRROR=http://npm.sankuai.com/dist/iojs nvm"' >> ~/.profile
-
Create alias
mnpm
in.profile
fileecho "" >> ~/.profile echo 'alias mnpm="npm --registry=http://r.npm.sankuai.com \ --cache=$HOME/.cache/mnpm \ --disturl=http://npm.sankuai.com/dist/node \ --userconfig=$HOME/.mnpmrc"' >> ~/.profile
-
(Optional) Create alias
myarn
in.profile
fileecho "" >> ~/.profile echo 'alias myarn="YARN_CACHE_FOLDER=$HOME/.cache/myarn-cache NPM_CONFIG_USERCONFIG=$HOME/.myarnrc yarn"' >> ~/.profile
-
(Optional) Create
.myarnrc
fileecho ' registry=http://r.npm.sankuai.com cache=$HOME/.cache/myarn disturl=http://npm.sankuai.com/dist/node ' > ~/.myarnrc
-
Reload
.profile
if you don't want to init another session.source ~/.profile