Vuepress: 运行 npm run docs:dev经常报权限错误

Created on 26 Oct 2019  ·  5Comments  ·  Source: vuejs/vuepress

在写入.temp 目录中的文件,权限变成了root,普通用户第二次执行dev命令的时候,就会报权限错误

Most helpful comment

Hi @tu6ge ,

Next time, please use English to describe your problem so everyone can help you.


Translation:

It requires root permission to write files into .temp folder. Ordinary users will encounter permission problems when running dev the second time.

All 5 comments

Hi @tu6ge ,

Next time, please use English to describe your problem so everyone can help you.


Translation:

It requires root permission to write files into .temp folder. Ordinary users will encounter permission problems when running dev the second time.

@tu6ge, please use the issue template next time you want to report a bug and as @ludanxer said, use english 😉. We can't help you as we don't know how to reproduce.

  • Remove temp folder
  • Run VuePress without root permissions (no sudo)

I Run VuePress without root

please give a minimal reproduction repos so we can help you

package.json

...
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "inspect": "vue-cli-service inspect",
    "lib": "vue-cli-service build --target lib --name apishow --dest lib packages/index.js",
    "docs:dev": "cross-env NODE_ENV=development vuepress dev docs",
    "docs:build": "cross-env NODE_ENV=production vuepress build docs",
    "precommit": "lint-staged"
  },
...

I run this commands

rm -rf node_moudles
yarn install
tu6ge@tu6ge-desktop:~/vue/api-show$ npm run docs:dev

> [email protected] docs:dev /home/tu6ge/vue/api-show
> cross-env NODE_ENV=development vuepress dev docs

wait Extracting site metadata...
tip Apply local theme at /home/tu6ge/vue/api-show/docs/.vuepress/theme...
tip Apply theme local (extends @vuepress/theme-default) ...
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
tip Apply plugin @vuepress/last-updated (i.e. "@vuepress/plugin-last-updated") ...
tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
tip Apply plugin @vuepress/active-header-links (i.e. "@vuepress/plugin-active-header-links") ...
tip Apply plugin @vuepress/search (i.e. "@vuepress/plugin-search") ...
tip Apply plugin @vuepress/nprogress (i.e. "@vuepress/plugin-nprogress") ...
tip Apply plugin @api-show/aps (i.e. "@api-show/vuepress-plugin-aps") ...
tip Apply plugin @vuepress/google-analytics (i.e. "@vuepress/plugin-google-analytics") ...
tip Apply plugin gitalk-maker (i.e. "vuepress-plugin-gitalk-maker") ...

● Client █████████████████████████ compiling (0%)  


ℹ 「wds」: Project is running at http://0.0.0.0:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/tu6ge/vue/api-show/docs/.vuepress/public
ℹ 「wds」: 404s will fallback to /index.html
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/tu6ge/vue/api-show/docs'
    at FSWatcher.start (internal/fs/watchers.js:165:26)
    at Object.watch (fs.js:1258:11)
    at createFsWatchInstance (/home/tu6ge/vue/api-show/node_modules/chokidar/lib/nodefs-handler.js:38:15)
    at setFsWatchListener (/home/tu6ge/vue/api-show/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/tu6ge/vue/api-show/node_modules/chokidar/lib/nodefs-handler.js:233:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/tu6ge/vue/api-show/node_modules/chokidar/lib/nodefs-handler.js:429:19)
    at FSWatcher.<anonymous> (/home/tu6ge/vue/api-show/node_modules/chokidar/lib/nodefs-handler.js:477:19)
    at FSWatcher.<anonymous> (/home/tu6ge/vue/api-show/node_modules/chokidar/lib/nodefs-handler.js:482:16)
    at FSReqWrap.oncomplete (fs.js:154:5)
Emitted 'error' event at:
    at FSWatcher._handleError (/home/tu6ge/vue/api-show/node_modules/chokidar/index.js:260:10)
    at createFsWatchInstance (/home/tu6ge/vue/api-show/node_modules/chokidar/lib/nodefs-handler.js:40:5)
    at setFsWatchListener (/home/tu6ge/vue/api-show/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    [... lines matching original stack trace ...]
    at FSReqWrap.oncomplete (fs.js:154:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] docs:dev: `cross-env NODE_ENV=development vuepress dev docs`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] docs: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/tu6ge/.npm/_logs/2019-10-29T12_58_45_251Z-debug.log



md5-a5690e13159cc42a507a1583db4adbe6



sudo npm run docs:dev
success [21:02:18] Build 89ea3c finished in 565 ms! ( http://localhost:8080/ )
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sankincn picture sankincn  ·  3Comments

ynnelson picture ynnelson  ·  3Comments

AMontagu picture AMontagu  ·  3Comments

shaodahong picture shaodahong  ·  3Comments

lesliecdubs picture lesliecdubs  ·  3Comments