运行 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 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
最佳答案

以下是我使用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 命令安装

5年前 评论
Icebreaking 3年前
讨论数量: 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 命令安装

5年前 评论
Icebreaking 3年前

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

5年前 评论

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

5年前 评论
leo

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

5年前 评论

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

5年前 评论
zhaocrazy

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

5年前 评论

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

5年前 评论

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

5年前 评论

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

5年前 评论
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 清除 依旧报错 我卡这里了

5年前 评论

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

5年前 评论

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

5年前 评论

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

5年前 评论
smartCodeing

@huzhuolei 我的也是卡在第四步

5年前 评论

以下是我使用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 命令安装

5年前 评论
Icebreaking 3年前

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

5年前 评论

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

5年前 评论

首先查看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就好了
5年前 评论
TigerLin

@jiangmeishui 不好使

5年前 评论
TigerLin

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

5年前 评论

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

5年前 评论

楼主这个问题只要加上--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

5年前 评论
Two-Two 4年前

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

5年前 评论

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

4年前 评论

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