New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu boom when hexo g -w #3239

Open
itibbers opened this Issue Aug 27, 2018 · 4 comments

Comments

2 participants
@itibbers

itibbers commented Aug 27, 2018

Environment Info

Node version(node -v):

v9.4.0

Hexo and Plugin version(npm ls --depth 0):

├── hexo@3.7.1
├── hexo-deployer-git@0.3.1
├── hexo-generator-archive@0.1.5
├── hexo-generator-category@0.1.3
├── hexo-generator-feed@1.2.2
├── hexo-generator-index@0.2.1
├── hexo-generator-sitemap@1.2.0
├── hexo-generator-tag@0.2.0
├── hexo-renderer-ejs@0.3.1
├── hexo-renderer-jade@0.4.1
├── hexo-renderer-marked@0.3.2
├── hexo-renderer-stylus@0.3.3
└── hexo-server@0.3.3

In my theme:

├── gulp@3.9.1
├── gulp-autoprefixer@6.0.0
└── gulp-sass@4.0.1

For BUG

  1. BUG description
$ ps aux
USER               PID  %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
Ive              17774 188.8  1.8  5228800 151416 s009  R+    6:31PM   3:21.45 hexo   
Ive              15711   6.4  0.6  4503688  49388   ??  S    Thu05PM  40:34.91 /System/Library/PrivateFrameworks/CloudKitDaemon.framework/Support/cloudd
  1. The way to reproduce
cd themes/xxxx
npm i
# node_moduels generating...
hexo g -w

then my cpu boom.

But when:

rm -rf themes/xxxx/node_modules
hexo g -w

my cpu is calm down.

  1. Log with hexo --debug
# node_moduels exist.
INFO  Files loaded in 6.01 s

# after delete node_modules
INFO  Files loaded in 1.13 s

For question

  1. What should I do with node_modules?
  2. Is there a bug in --watch command?
@tomap

This comment has been minimized.

Show comment
Hide comment
@tomap

tomap Aug 27, 2018

Contributor

Hexo click is supposed to work in your root folder, not the theme folder. Not sure what happened there? Does your theme have a package.json?

Contributor

tomap commented Aug 27, 2018

Hexo click is supposed to work in your root folder, not the theme folder. Not sure what happened there? Does your theme have a package.json?

@itibbers

This comment has been minimized.

Show comment
Hide comment
@itibbers

itibbers Aug 28, 2018

@tomap yeah, there is a package.json in my theme/xxxx folder, I'm not sure if I'm doing this right.

itibbers commented Aug 28, 2018

@tomap yeah, there is a package.json in my theme/xxxx folder, I'm not sure if I'm doing this right.

@tomap

This comment has been minimized.

Show comment
Hide comment
@tomap

tomap Aug 28, 2018

Contributor

You should only run hexo CLI in root folder. I think the package.json is for building your theme only. Maybe you could provide the theme name and the content of package.json in theme

Contributor

tomap commented Aug 28, 2018

You should only run hexo CLI in root folder. I think the package.json is for building your theme only. Maybe you could provide the theme name and the content of package.json in theme

@itibbers

This comment has been minimized.

Show comment
Hide comment
@itibbers

itibbers Sep 2, 2018

I only run hexo CLI in root folder.

This is my package.json in themes/xxxx folder.

{
  "name": "hexo-theme-apple",
  "version": "1.0.0",
  "description": "A simple theme for Hexo",
  "main": "index.js",
  "scripts": {
    "sass": "gulp sass"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "keywords": [
    "hexo",
    "theme",
    "simple"
  ],
  "author": "iTibbers",
  "license": "MIT",
  "bugs": {
    "url": ""
  },
  "homepage": "",
  "devDependencies": {
    "gulp": "^3.9.1",
    "gulp-autoprefixer": "^6.0.0",
    "gulp-sass": "^4.0.1"
  }
}

itibbers commented Sep 2, 2018

I only run hexo CLI in root folder.

This is my package.json in themes/xxxx folder.

{
  "name": "hexo-theme-apple",
  "version": "1.0.0",
  "description": "A simple theme for Hexo",
  "main": "index.js",
  "scripts": {
    "sass": "gulp sass"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "keywords": [
    "hexo",
    "theme",
    "simple"
  ],
  "author": "iTibbers",
  "license": "MIT",
  "bugs": {
    "url": ""
  },
  "homepage": "",
  "devDependencies": {
    "gulp": "^3.9.1",
    "gulp-autoprefixer": "^6.0.0",
    "gulp-sass": "^4.0.1"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment