gpt4 book ai didi

vue.js - 如何修复 Visual Studio Code 中的 "Error: Watching remote files is not supported"问题

转载 作者:搜寻专家 更新时间:2023-10-30 22:21:04 24 4
gpt4 key购买 nike

我有一段时间没有运行的 Vue 应用程序,现在我无法启动开发服务器?!与此同时,更新了一些东西但不起作用。我尝试了新的干净 vue/vuetify 安装和同样的问题!

为生产构建正常工作,只运行开发服务器不工作。

还有重要提示:当在命令提示符下(在 VS Code 之外)运行“npm run serve”时,它可以正常工作。这不仅适用于 VS 代码终端。有什么问题?

节点版本为 v10.16.0npm 版本为 6.10.3

VS 代码关于:

Commit: 036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8
Date: 2019-08-08T02:33:50.993Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.17763

错误(来自终端窗口):

> Executing task: npm run serve <


> portal@0.1.0 serve d:\Wamp64\www\portal
> vue-cli-service serve

INFO Starting development server...
10% building 2/2 modules 0 active ERROR Error: Watching remote files is not supported.
Error: Watching remote files is not supported.
at Server.setupWatchStaticFeature (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:405:13)
at Object.watchContentBase (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:477:14)
at forEach (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:550:24)
at Array.forEach (<anonymous>)
at Server.setupFeatures (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:549:49)
at new Server (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:125:10)
at serve (d:\Wamp64\www\portal\node_modules\@vue\cli-service\lib\commands\serve.js:139:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! portal@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the portal@0.1.0 serve 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! C:\Users\Sasa Gosovic\AppData\Roaming\npm-cache\_logs\2019-08-11T10_35_40_418Z-debug.log
The terminal process terminated with exit code: 1

Press any key to close the terminal.

最佳答案

这里完全一样的问题。我通过回滚 webpack-dev-server 的版本解决了这个问题。

npm install webpack-dev-server@3.7.2 --save-dev

看起来 setupWatchStaticFeature 函数在 3.7.2 和 3.8.0 之间发生了变化,这触发了问题。

关于vue.js - 如何修复 Visual Studio Code 中的 "Error: Watching remote files is not supported"问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57449355/

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