hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.46k stars 4.85k forks source link

executing ‘hexo’ command through out confusing error with node v5.0.0+ #1597

Closed zekeair closed 8 years ago

zekeair commented 8 years ago

host context: mac Yosemite 10.10.4; node version V5.0.0/V5.1.0;

error output: [Error: Module version mismatch. Expected 47, got 14.] { [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' } { [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }

ghost commented 8 years ago

Try This: sudo npm install hexo --no-optional

(It works for me but I don't know why)

imruxin commented 8 years ago

The same problem

node version V5.0.0;

[Error: Module version mismatch. Expected 47, got 46.]
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
Xuanwo commented 8 years ago

happened before. It looks like DTraceProviderBindings is a module on Mac and without it there will be a error. use sudo npm install hexo --no-optional will skip this error

CharlesHolbrow commented 8 years ago

I'm having the same problem. Additionally, when I run $ hexo server my browser doesn't automatically refresh. According to this page, it should refresh automatically: https://hexo.io/docs/server.html

When I installed I got this warning:

$ python --version
Python 3.4.3 :: Anaconda 2.3.0 (x86_64)
$ npm install
-
> fsevents@0.3.8 install /Users/Charles/projects/hexo-blog/node_modules/hexo/node_modules/nunjucks/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: Python executable "python" is v3.4.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:121:14)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:110:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:194:7)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:818:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/charles/projects/hexo-blog/node_modules/hexo/node_modules/nunjucks/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 

> dtrace-provider@0.6.0 install /Users/charles/projects/hexo-blog/node_modules/hexo/node_modules/bunyan/node_modules/dtrace-provider
> node scripts/install.js

---------------
Building dtrace-provider failed with exit code 1 and signal 0
re-run install with environment variable V set to see the build output
---------------
npm WARN optional dep failed, continuing fsevents@0.3.8

> fsevents@1.0.5 install /Users/charles/projects/hexo-blog/node_modules/hexo/node_modules/hexo-fs/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

[fsevents] Success: "/Users/charles/projects/hexo-blog/node_modules/hexo/node_modules/hexo-fs/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" is installed via remote
hexo-generator-tag@0.1.2 node_modules/hexo-generator-tag
├── object-assign@2.1.1
└── hexo-pagination@0.0.2 (utils-merge@1.0.0)

hexo-generator-category@0.1.3 node_modules/hexo-generator-category
├── object-assign@2.1.1
└── hexo-pagination@0.0.2 (utils-merge@1.0.0)

hexo-generator-index@0.1.3 node_modules/hexo-generator-index
├── object-assign@2.1.1
└── hexo-pagination@0.0.2 (utils-merge@1.0.0)

hexo-generator-archive@0.1.3 node_modules/hexo-generator-archive
├── object-assign@2.1.1
└── hexo-pagination@0.0.2 (utils-merge@1.0.0)

hexo-renderer-ejs@0.1.0 node_modules/hexo-renderer-ejs
├── lodash@2.4.2
└── ejs@1.0.0

hexo-server@0.1.2 node_modules/hexo-server
├── object-assign@2.1.1
├── open@0.0.5
├── mime@1.3.4
├── bluebird@2.10.2
├── chalk@0.5.1 (escape-string-regexp@1.0.3, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── morgan@1.6.1 (on-headers@1.0.1, basic-auth@1.0.3, depd@1.0.1, on-finished@2.3.0, debug@2.2.0)
├── connect@3.4.0 (utils-merge@1.0.0, parseurl@1.3.0, debug@2.2.0, finalhandler@0.4.0)
├── serve-static@1.10.0 (escape-html@1.0.2, parseurl@1.3.0, send@0.13.0)
└── compression@1.6.0 (bytes@2.1.0, on-headers@1.0.1, vary@1.1.0, debug@2.2.0, compressible@2.0.6, accepts@1.3.0)

hexo-renderer-stylus@0.3.0 node_modules/hexo-renderer-stylus
├── stylus@0.52.4 (css-parse@1.7.0, debug@2.2.0, mkdirp@0.5.1, sax@0.5.8, source-map@0.1.43, glob@3.2.11)
└── nib@1.1.0 (stylus@0.49.3)

hexo-renderer-marked@0.2.5 node_modules/hexo-renderer-marked
├── object-assign@2.1.1
├── marked@0.3.5
├── strip-indent@1.0.1 (get-stdin@4.0.1)
└── hexo-util@0.1.7 (ent@2.2.0, bluebird@2.10.2, highlight.js@8.9.1)

hexo@3.1.1 node_modules/hexo
├── hexo-front-matter@0.2.2
├── pretty-hrtime@1.0.1
├── abbrev@1.0.7
├── titlecase@1.0.2
├── archy@1.0.0
├── text-table@0.2.0
├── strip-indent@1.0.1 (get-stdin@4.0.1)
├── tildify@1.1.2 (os-homedir@1.0.1)
├── chalk@1.1.1 (escape-string-regexp@1.0.3, supports-color@2.0.0, ansi-styles@2.1.0, strip-ansi@3.0.0, has-ansi@2.0.0)
├── hexo-i18n@0.2.1 (sprintf-js@1.0.3)
├── moment-timezone@0.3.1
├── minimatch@2.0.10 (brace-expansion@1.1.1)
├── bluebird@2.10.2
├── through2@1.1.1 (xtend@4.0.1, readable-stream@1.1.13)
├── swig-extras@0.0.1 (markdown@0.5.0)
├── warehouse@1.0.3 (graceful-fs@4.1.2, cuid@1.2.5, JSONStream@1.0.7)
├── js-yaml@3.4.5 (esprima@2.7.0, argparse@1.0.3)
├── moment@2.10.6
├── hexo-cli@0.1.9 (minimist@1.2.0, bluebird@3.0.5)
├── swig@1.4.2 (optimist@0.6.1, uglify-js@2.4.24)
├── cheerio@0.19.0 (entities@1.1.1, dom-serializer@0.1.0, css-select@1.0.0, htmlparser2@3.8.3)
├── nunjucks@1.3.4 (optimist@0.6.1, chokidar@0.12.6)
├── hexo-util@0.1.7 (ent@2.2.0, highlight.js@8.9.1)
├── bunyan@1.5.1 (safe-json-stringify@1.0.3, mv@2.1.1, dtrace-provider@0.6.0)
├── lodash@3.10.1
└── hexo-fs@0.1.5 (escape-string-regexp@1.0.3, graceful-fs@4.1.2, bluebird@3.0.5, chokidar@1.3.0)
Xuanwo commented 8 years ago

it looks like fsevents don't support node 5.0. I succeed in node 5.1 without fsevents

CharlesHolbrow commented 8 years ago

Is that why $ hexo server doesn't auto reload?

Xuanwo commented 8 years ago

Yes, at least I think so.

leesei commented 8 years ago

Original issue was fixed with --no-optional.

leggetter commented 8 years ago

Related https://github.com/hexojs/hexo/issues/1742#issuecomment-238649006