运行 yarn 的时候一直报错

vagrant@homestead:~/code/laravel-shop$ SASS_BINARY_SITE=http://npm.taobao.org/mirrors/node-sass yarn install --no-bin-links
yarn install v1.12.3
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > sass-loader@7.1.0" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
[4/4] Building fresh packages...
error /home/vagrant/code/laravel-shop/node_modules/webpack-cli: Command failed.
Exit code: 127
Command: lightercollective
Arguments:
Directory: /home/vagrant/code/laravel-shop/node_modules/webpack-cli
Output:
/bin/sh: 1: lightercollective: not found
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
最佳答案

以下是我使用 Laravel 5.7,发现问题后的解决方法,希望对你有所帮助:
1、这里的报错提示是 :lightercollective: not found,所以先使用 sudo npm i -g lightercollective 命令安装,
之后再执行 SASS_BINARY_SITE=http://npm.taobao.org/mirrors/node-sass yarn --no-bin-links

2、执行 npm run watch-poll 的时候如果提示 “Running: yarn add vue-template-compiler --dev --production=false Running: yarn add vue-template-compiler --dev --production=false“,就使用 yarn add vue-template-compiler --dev --production=false --no-bin-links 命令安装

6年前 评论
Icebreaking 4年前
讨论数量: 24

以下是我使用 Laravel 5.7,发现问题后的解决方法,希望对你有所帮助:
1、这里的报错提示是 :lightercollective: not found,所以先使用 sudo npm i -g lightercollective 命令安装,
之后再执行 SASS_BINARY_SITE=http://npm.taobao.org/mirrors/node-sass yarn --no-bin-links

2、执行 npm run watch-poll 的时候如果提示 “Running: yarn add vue-template-compiler --dev --production=false Running: yarn add vue-template-compiler --dev --production=false“,就使用 yarn add vue-template-compiler --dev --production=false --no-bin-links 命令安装

6年前 评论
Icebreaking 4年前

win10 64 位系统,vagrant 安装的 lc-homestead-6.1.1-2018090400 盒子,homestead 7.8.0,laravel 5.7 会出这个问题,5.5 正常

6年前 评论

刚刚在我的 macbook 上测试了一下,也是一样的问题。这是普遍问题还是我的特例呀?普遍问题的话为什么网上找不到解决方案呢?特例的话为什么两台电脑都出现同样的问题?

6年前 评论
leo

我这边试了一下,在 Mac 下不加 --no-bin-links 就不会报这个错

6年前 评论

同求解决方案新的 homestead 新的 lara 5.7 项目 yarn install --no-bin-links 报错啦

6年前 评论
zhaocrazy

有人解决了吗 环境问题坑死

6年前 评论

@leo 在 Mac 下不加 --no-bin-links 是另一个常见的错误,加了解决了那个常见错误出现这个错误,大牛看看这个错误怎么办呀?难道只能用 5.5?

6年前 评论

@daxiaobuzhaodiao 你也是这个错误?那看来是普遍的问题了

6年前 评论

@huzhuolei 是的, 你解决了么?还是换成 5.5 了?

6年前 评论
zhaocrazy

@daxiaobuzhaodiao @huzhuolei win10 64 位系统,vagrant 安装的 lc-homestead-6.1.1-2018090400 盒子,homestead 7.8.0,laravel 5.7 2.6 基础布局会出这个问题 执行 sudo npm install npm@latest -g 升级 可解决 但后面 3.4 新增地址模块 yarn add china-area-data 我执行命令 npm run watch-poll 编译后 会把包 china-area-data 清除 依旧报错 我卡这里了

6年前 评论

@zhaocrazy laravel5.7.19 执行 yarn install 生成 node_modules 里面多了个 wabpack-cli 的东西,我现在索性使用 5.7.15 了 。

6年前 评论

@daxiaobuzhaodiao 学习环境用回 5.5 了,开发环境用的 5.7。因为是做 RESTFul api 开发,暂时用不到前端框架组件

6年前 评论

嗯,我的也出现同样问题. @Summer 关注一下这个问题.

6年前 评论
smartCodeing

@huzhuolei 我的也是卡在第四步

6年前 评论

以下是我使用 Laravel 5.7,发现问题后的解决方法,希望对你有所帮助:
1、这里的报错提示是 :lightercollective: not found,所以先使用 sudo npm i -g lightercollective 命令安装,
之后再执行 SASS_BINARY_SITE=http://npm.taobao.org/mirrors/node-sass yarn --no-bin-links

2、执行 npm run watch-poll 的时候如果提示 “Running: yarn add vue-template-compiler --dev --production=false Running: yarn add vue-template-compiler --dev --production=false“,就使用 yarn add vue-template-compiler --dev --production=false --no-bin-links 命令安装

6年前 评论
Icebreaking 4年前

@ezyx 前辈,首先非常感谢您的方法,问题已经解决,您能不能解释一下这个问题? 为什么会出这样的错误。

6年前 评论

@ezyx 虽然不知道为啥报错 为啥解决的,非常感谢!

6年前 评论

首先查看 laravel 版本
artisan --version
如果显示的是
Laravel Framework 5.7.19
那么有可能是 laravel 版本引起的问题
解决办法:将 laravel 版本降至 5.7.15
步骤:

  1. 将 composer.json 文件中的 "laravel/framework": "5.7.19" 改为 "laravel/framework": "5.7.15", 然后用 composer 更新
  2. 在框架版本降至 5.7.15 后 执行 rm -rf node_modules
  3. 执行 yarn install, 不要加 --no-bin-links
  4. 执行 npm run watch-poll 就好了
6年前 评论
TigerLin

@jiangmeishui 不好使

6年前 评论
TigerLin

还是改到 5.7.15 好使 但是执行 yarn install, 还要加 --no-bin-links
npm run watch-poll 不要加 --no-bin-links

6年前 评论

@ezyx 困扰了三天的问题,终于解决了,感谢前辈!

6年前 评论

楼主这个问题只要加上 --no-bin-links 变成 SASS_BINARY_SITE=http://npm.taobao.org/mirrors/node-sass yarn --no-bin-links 会变成

file
然后执行 npm run watch-poll 会变成

file
然后删除 package.json 中的三处 cross-env(图片在最后)
再次执行 npm run watch-poll

file 启动成功 亲测可用(laravel5.7.15 其余的没试过)- 希望对你们有帮助 blush: :blush: :blush:

file

6年前 评论
Two-Two 5年前

npm run watch-poll 这个命令也要加 --no-bin-links(5.7.28 版本)第二遍成功

6年前 评论

@ezyx 前辈,非常感谢您的方法,问题已经解决,但是加载首页的时候为什么好慢啊?

5年前 评论