laravel8 执行 npm run watch-poll报错!求解决方法。
一,按照教程执行: SASS_BINARY_SITE=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 > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
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 popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
[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...
warning " > sass-loader@8.0.2" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../parser/bin/babel-parser.js' -> '/home/vagrant/Code/Laravel/node_modules/@babel/core/node_modules/.bin/parser'".
info If you think this is a bug, please open a bug report with the information provided in "/home/vagrant/Code/Laravel/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
二,执行 yarn add cross-env
报错如下:
yarn add 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
warning popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
[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...
warning " > sass-loader@8.0.2" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../parser/bin/babel-parser.js' -> '/home/vagrant/Code/Laravel/node_modules/@babel/core/node_modules/.bin/parser'".
info If you think this is a bug, please open a bug report with the information provided in "/home/vagrant/Code/Laravel/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
三, npm run watch-poll
bao报错如下:
vagrant@homestead:~/Code/Laravel$ npm run watch-poll
> @ watch-poll /home/vagrant/Code/Laravel
> mix watch -- --watch-options-poll=1000
sh: 1: mix: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! @ watch-poll: `mix watch -- --watch-options-poll=1000`
npm ERR! spawn ENOENT
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-01-31T12_47_33_495Z-debug.log
高认可度评论:
@小码崽子。 谢谢你
我是遇到 mix: not found,
解决方式按你说的就解决了。
我详细说下,
我遇到楼主说的问题后。
先清除之前的修改:
git checkout master
git branch -d filling-layout-style
git checkout -b filling-layout-style
关闭 homestead
vagrant halt
关闭windows终端
以管理员权限启动终端
在有管理员权限的终端启动 homestead:
vagrant up
vagrant ssh
按教程步骤执行
我再win7系统上也出现了类似这样的错误
@懒惰的大叔 @Gyh1996 问题解决了没有啊
把
node_modules
文件夹删除,再npm install
6可以正常,但8一直不正常,我把scripts的内容替换为laraval6的内容,这样就可以正常运行了 但要注意:
提高终端权限,以管理员运行,原因是没有权限创建软连接
@小码崽子。 谢谢你
我是遇到 mix: not found,
解决方式按你说的就解决了。
我详细说下,
我遇到楼主说的问题后。
先清除之前的修改:
git checkout master
git branch -d filling-layout-style
git checkout -b filling-layout-style
关闭 homestead
vagrant halt
关闭windows终端
以管理员权限启动终端
在有管理员权限的终端启动 homestead:
vagrant up
vagrant ssh
按教程步骤执行
你应该是在windows下用Homestead共享code文件夹开发的吧。教程自己用的是mac所以不存在这个问题。这个是Homestead无法在windows创建软链接造成的。
你只能在windows安装npm 然后在项目文件里按照教程操作就能解决。
之后的watch-poll
也只能在windows里运行