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
尝试方案
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
结果如下
根据上面报错百度了一下,发现是没有权限的原因, 那么加上sudo
重新尝试。
sudo npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
结果如下
这时心态有点崩,开始乱试。
npm install node-sass -g
提示没有权限报错,加sudo
再试。
sudo npm install node-sass -g
结果如下
当我看到报错中有这么一行This is probably not a problem with npm
我就再次尝试了一下
yarn install --no-bin-links
结果成功了
唉,开心得太早,进错目录了。 去回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》
推荐文章: