通过yarn 安装 一直卡在 canvas 这个包 无法安装
在这里插入图片描述

yarn

在项目根目录 如果有 .yarnrc 文件 增加

canvas_binary_host_mirror "https://npm.taobao.org/mirrors/node-canvas-prebuilt/"

没有 增加 一个 .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"

canvas_binary_host_mirror "https://npm.taobao.org/mirrors/node-canvas-prebuilt/"

npm

在项目根目录 如果有 .npmrc 文件 增加

canvas_binary_host_mirror = "https://npm.taobao.org/mirrors/node-canvas-prebuilt/"

没有 增加 一个 .npmrc 文件 添加下面内容

home="https://npm.taobao.org"
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"

canvas_binary_host_mirror= "https://npm.taobao.org/mirrors/node-canvas-prebuilt/"
Logo

前往低代码交流专区

更多推荐