blog icon indicating copy to clipboard operation
blog copied to clipboard

执行bat安装依赖时候,服务端依赖报错 滞留在nodemon sharp(解决方案)

Open HuangDaohong opened this issue 3 years ago • 6 comments

HuangDaohong avatar Aug 01 '22 16:08 HuangDaohong

切换淘宝源,node版本使用16 链接

Lrunlin avatar Aug 11 '22 09:08 Lrunlin

No description provided.

如果目前有博客网站使用需求的话暂时建议您去我的主要查找一个叫web_blog的项目,这个大型博客社区网站还在开发中

Lrunlin avatar Aug 11 '22 12:08 Lrunlin

可以新建.npmrc文件,然后添加:

sharp_libvips_binary_host=https://npmmirror.com/mirrors/sharp-libvips
sharp_binary_host=https://npmmirror.com/mirrors/sharp

这样的话,就不需要因为一个包的问题导致需要切换全局镜像了

参考:https://sharp.pixelplumbing.com/install#chinese-mirror

galaxy-s10 avatar Sep 23 '22 13:09 galaxy-s10

因为client和server都使用到了插件sharp,同时node-sass在安装时也可能遇到网络问题。建议不使用.npmrc文件直接参考https://blogweb.cn/article/6064301711 进行换源

Lrunlin avatar Sep 24 '22 02:09 Lrunlin

将sass也添加进.npmrc就好了

galaxy-s10 avatar Sep 24 '22 09:09 galaxy-s10

感觉相对麻烦,而且里面有三个package

Lrunlin avatar Sep 24 '22 13:09 Lrunlin