gpt4 book ai didi

javascript - VuePress 未在开发服务器中运行

转载 作者:行者123 更新时间:2023-11-30 14:34:39 26 4
gpt4 key购买 nike

我在本地从github克隆了一个repo,是VuePress相关的代码。在 package.json 文件中只有以下脚本。

"scripts": {
"build": "vuepress build",
"test": "rm -rf .vuepress/dist && npm run build && stat .vuepress/dist/index.html"
},

但我想在我的本地浏览器中运行它,所以我添加了一个开发脚本,如下所示

  "scripts": {
"build": "vuepress build",
"dev" : "vuepress dev",

"test": "rm -rf .vuepress/dist && npm run build && stat .vuepress/dist/index.html"
},

显示如下错误

node_modules/core-js/modules/es6.array.for-each.js

events.js:137
throw er; // Unhandled 'error' event
^

Error: watch /media/itsd/ITSD/vuepress-base/node_modules/npm/doc/cli/npm-completion.md ENOSPC
at _errnoException (util.js:1003:13)
at FSWatcher.start (fs.js:1397:19)
at Object.fs.watch (fs.js:1423:11)
at createFsWatchInstance (/media/itsd/ITSD/vuepress-base/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/media/itsd/ITSD/vuepress-base/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/media/itsd/ITSD/vuepress-base/node_modules/chokidar/lib/nodefs-handler.js:229:14)
at FSWatcher.NodeFsHandler._handleFile (/media/itsd/ITSD/vuepress-base/node_modules/chokidar/lib/nodefs-handler.js:256:21)
at FSWatcher.<anonymous> (/media/itsd/ITSD/vuepress-base/node_modules/chokidar/lib/nodefs-handler.js:474:21)
at FSReqWrap.oncomplete (fs.js:167:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vuepress-base@1.0.0 dev: `vuepress dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vuepress-base@1.0.0 dev 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/itsd/.npm/_logs/2018-05-30T05_06_55_941Z-debug.log

通过运行 vuepress build 生成了静态文件,但我想在我的 8080 端口上运行它。任何人都请帮助我。

最佳答案

当我们超过通知观察者的限制时,就会发生这种情况。以下命令解决了这个问题:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

关于javascript - VuePress 未在开发服务器中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50597514/

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