gpt4 book ai didi

laravel - "npm run watch"不工作并返回错误 's saying ' 缺少 "Watch"'

转载 作者:行者123 更新时间:2023-12-05 08:24:45 24 4
gpt4 key购买 nike

在添加 tailwind 模板后的新 laravel 项目中,我尝试运行 npm run watch 但它不起作用,因此模板也没有正确加载。

$ npm run watch                                                       
npm ERR! Missing script: "watch"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\U-S-E-R\AppData\Local\npm-cache\_logs\2022-07-27T18_05_36_192Z-debug-0.log

Here is the Error Screenshot

最佳答案

更新您的 package.json 文件。

...
"scripts": {
"dev": "vite",
"build": "vite build",
"watch": "vite build --watch"
},
...

引用:https://vitejs.dev/guide/build.html#rebuild-on-files-changes https://laracasts.com/discuss/channels/vite/equivalent-of-vite-watch?reply=809106

现在试试运行

npm run dev
npm run watch

关于laravel - "npm run watch"不工作并返回错误 's saying ' 缺少 "Watch"',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73142864/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com