yarn install --no-bin-links 报错

问题描述

环境

macOS Catalina 10.15.1
Vagrant 2.2.9
VirtualBox Manager 6.1.0
Homestead Box 使用教程提供的 lc-homestead-8.2.1-2019112300

执行

 yarn install --no-bin-links

报错

 node_modules\node sass:Command failed

yarn install --no-bin-links 报错 node_modules\node sass:Command failed

尝试方案

npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
npm install node-sass
yarn install

执行

npm install -g mirror-config-china --registry=http://registry.npm.taobao.org


结果如下
yarn install --no-bin-links 报错 node_modules\node sass:Command failed
根据上面报错百度了一下,发现是没有权限的原因, 那么加上sudo重新尝试。

sudo npm install -g mirror-config-china --registry=http://registry.npm.taobao.org

结果如下

yarn install --no-bin-links 报错 node_modules\node sass:Command failed
这时心态有点崩,开始乱试。

npm install  node-sass  -g

提示没有权限报错,加sudo再试。

sudo npm install node-sass -g

结果如下

yarn install --no-bin-links 报错 node_modules\node sass:Command failed
当我看到报错中有这么一行This is probably not a problem with npm
我就再次尝试了一下

yarn install --no-bin-links

结果成功了
yarn install --no-bin-links 报错 node_modules\node sass:Command failed
唉,开心得太早,进错目录了。 去回myblog项目,还是回到了原点。尝试执行

sudo yarn install --no-bin-links
参考文章

《【已解决】使用 yarn 安装时,报错node_modules\node sass:Command failed.》
《error /app/node_modules/node-sass: Command failed. #1149》
《 mac安装报错Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules》

《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!