我在本地从github克隆了一个回购程序,这是一个与VuePress相关的代码。在package.json文件中,它只有以下脚本。
"scripts": {
"build": "vuepress build",
"test": "rm -rf .vuepress/dist && npm run build && stat .vuepress/dist/index.html"
},但是我想在本地浏览器中运行它,所以我添加了一个dev脚本,如下所示
"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端口中运行它。任何人都可以帮我这个忙。
发布于 2018-06-24 18:43:08
当我们超过通知观察器的限制时,就会发生这种情况。以下命令修复了这个问题:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -phttps://stackoverflow.com/questions/50597514
复制相似问题