安装nodejs,npm,yarn
先安装nodejs和npm
sudo apt update
sudo apt install nodejs npm
#验证一下
nodejs --version
npm --version
如果nodejs不好使,可以试试设置alias node=nodejs
然后安装yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn
因为伟大firewall的缘故,直接使用可能一直转圈圈,所以要改源
yarn cache clean
gedit ~/.yarnrc
#加入
registry "https://registry.npm.taobao.org"
sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"
phantomjs_cdnurl "http://cnpmjs.org/downloads"
electron_mirror "https://npm.taobao.org/mirrors/electron/"
sqlite3_binary_host_mirror "https://foxgis.oss-cn-shanghai.aliyuncs.com/"
profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector/"
chromedriver_cdnurl "https://cdn.npm.taobao.org/dist/chromedriver"
再不行就挂小飞机进一步走出国门
然后就可以执行yarn install这些基本操作了。
没有什么一直Building fresh packages等问题。