npm run watch-poll 报错

系统 win10专业版

L01 Laravel 教程 - Web 开发实战入门 ( Laravel 8.x ) /
版本8.x

章节 4.2. 样式美化

vagrant@homestead:~/Code/weibo$ npm run watch-poll

> @ watch-poll /home/vagrant/Code/weibo
> 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-07-29T08_54_55_998Z-debug.log

log文件内容

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'watch-poll' ]
2 info using npm@6.14.11
3 info using node@v14.15.4
4 verbose run-script [ 'prewatch-poll', 'watch-poll', 'postwatch-poll' ]
5 info lifecycle @~prewatch-poll: @
6 info lifecycle @~watch-poll: @
7 verbose lifecycle @~watch-poll: unsafe-perm in lifecycle true
8 verbose lifecycle @~watch-poll: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/vagrant/Code/weibo/node_modules/.bin:/home/vagrant/.config/composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle @~watch-poll: CWD: /home/vagrant/Code/weibo
10 silly lifecycle @~watch-poll: Args: [ '-c', 'mix watch -- --watch-options-poll=1000' ]
11 info lifecycle @~watch-poll: Failed to exec watch-poll script
12 verbose stack Error: @ watch-poll: `mix watch -- --watch-options-poll=1000`
12 verbose stack spawn ENOENT
12 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack     at ChildProcess.emit (events.js:315:20)
12 verbose stack     at maybeClose (internal/child_process.js:1048:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
13 verbose pkgid @
14 verbose cwd /home/vagrant/Code/weibo
15 verbose Linux 5.4.0-65-generic
16 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "watch-poll"
17 verbose node v14.15.4
18 verbose npm  v6.14.11
19 error code ELIFECYCLE
20 error syscall spawn
21 error file sh
22 error errno ENOENT
23 error @ watch-poll: `mix watch -- --watch-options-poll=1000`
23 error spawn ENOENT
24 error Failed at the @ watch-poll script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 5
2年前 评论
誓言玄夏 (楼主) 2年前

问题已解决

解决方案:使用win10的wsl2 安装宝塔作为本地开发环境

2年前 评论

我node是10版本, 升级到16版本后,就好了; 不知道是不是你node版本问题

1年前 评论
誓言玄夏 (楼主) 1年前

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