☝️The node version must be the latest, if not, please execute
$ node -v
v8.5.0
$sudo npm install -g n
Password:
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
added 1 package in 3.477s
$ node -v
v8.5.0
$sudo n latest
install : node-v9.11.1
mkdir : /usr/local/n/versions/node/9.11.1
fetch : https://nodejs.org/dist/v9.11.1/node-v9.11.1-darwin-x64.tar.gz
######################################################################## 100.0%
installed : v9.11.1
1> git clone https://github.com/xxx/xxxxxx
2> npm install
3> When you have this problem: sudo npm install
npm --registry=https://registry.npm.taobao.org --cache=$HOME/.npm/.cache/cnpm --disturl=https://npm.taobao.org/dist --userconfig=$HOME/.cnpmrc install
sudo rm -rf /node_modules