laravel8 使用 Yarn 安装依赖报错?该怎么解决呢?
一,laravel8,跟着教程做,
执行$ SASS_BINARY_SITE=npm.taobao.org/mirrors/node-sass yarn报如下警告:
vagrant@homestead:~/Code/weibo$ SASS_BINARY_SITE=http://npm.taobao.org/mirrors/node-sass yarn
yarn install v1.19.0
info No lockfile found.
[1/4] Resolving packages...
warning laravel-mix > @types/browser-sync > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning laravel-mix > @types/autoprefixer > @types/browserslist@4.15.0: This is a stub types definition. browserslist provides its own type definitions, so you do not need this installed.
warning laravel-mix > @types/browser-sync > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning laravel-mix > @types/browser-sync > chokidar > braces > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning laravel-mix > @types/browser-sync > chokidar > braces > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
[2/4] Fetching packages...
info fsevents@2.3.1: The platform "linux" is incompatible with this module.
info "fsevents@2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 43.98s.
二,执行$ npm run watch-poll 报错如下:
vagrant@homestead:~/Code/weibo$ npm run watch-poll
> @ watch-poll /home/vagrant/Code/weibo
> mix watch -- --watch-options-poll=1000
Error: You are using an unspported version of Node. Please update to at least Node v12.14
at assertSupportedNodeVersion (/home/vagrant/Code/weibo/node_modules/laravel-mix/src/Engine.js:6:15)
at executeScript (/home/vagrant/Code/weibo/node_modules/laravel-mix/bin/cli.js:58:5)
at Command.<anonymous> (/home/vagrant/Code/weibo/node_modules/laravel-mix/bin/cli.js:36:13)
at Command.listener [as _actionHandler] (/home/vagrant/Code/weibo/node_modules/laravel-mix/node_modules/commander/index.js:426:31)
at Command._parseCommand (/home/vagrant/Code/weibo/node_modules/laravel-mix/node_modules/commander/index.js:1002:14)
at Command._dispatchSubcommand (/home/vagrant/Code/weibo/node_modules/laravel-mix/node_modules/commander/index.js:953:18)
at Command._parseCommand (/home/vagrant/Code/weibo/node_modules/laravel-mix/node_modules/commander/index.js:970:12)
at Command.parse (/home/vagrant/Code/weibo/node_modules/laravel-mix/node_modules/commander/index.js:801:10)
at Command.parseAsync (/home/vagrant/Code/weibo/node_modules/laravel-mix/node_modules/commander/index.js:828:10)
at run (/home/vagrant/Code/weibo/node_modules/laravel-mix/bin/cli.js:47:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch-poll: `mix watch -- --watch-options-poll=1000`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch-poll script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2021-02-01T11_40_16_228Z-debug.log
折腾了几天了,npm也试过了,Mac和Windows都会报错,laravel7好像可以执行成功。laravel8实在是不知道怎么解决,有会解决的朋友,可以评论取留言。
@Summer
推荐文章: