安装
dnf install npm
npm
更换为淘宝源
npm config -g set registry http://registry.npm.taobao.org/
npm config -g set puppeteer_download_host https://npm.taobao.org/mirrors
安装 chrome 驱动(puppeteer相关)
npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver
安装 node-sass
npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
清除缓存
npm cache clean --force
gyp 和 vs
npm install -g node-gyp
npm install --global --production windows-build-tools
cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
yarn
安装
npm install -g yarn --registry=https://registry.npm.taobao.org
更新
yarn global add yarn
切换为淘宝源
yarn config set registry https://registry.npm.taobao.org -g
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g
安装puppeteer
yarn config set puppeteer_download_host https://npm.taobao.org/mirrors -g
使用国内源tyarn
npm i yarn tyarn -g
pnpm
npm i pnpm -g
pnpm config set registry http://registry.npm.taobao.org