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

升级Node.js v6.0.0之后无法编译 #1939

Closed
pod4g opened this Issue May 3, 2016 · 24 comments

Comments

@pod4g

pod4g commented May 3, 2016

看到一个跟我类似的issue #1924
切换到 v5.8.0 就没有问题。

错误信息:

Error: Module version mismatch. Expected 48, got 47.
    at Error (native)
    at Object.Module._extensions..node (module.js:568:18)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/bunyan/lib/bunyan.js:79:18)
{ Error: Cannot find module './build/default/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:438:15)
    at Function.Module._load (module.js:386:25)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/bunyan/lib/bunyan.js:79:18)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/Debug/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:438:15)
    at Function.Module._load (module.js:386:25)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/bunyan/lib/bunyan.js:79:18)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32) code: 'MODULE_NOT_FOUND' }
Error: Module version mismatch. Expected 48, got 47.
    at Error (native)
    at Object.Module._extensions..node (module.js:568:18)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/liyanfeng/blog/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/liyanfeng/blog/node_modules/bunyan/lib/bunyan.js:79:18)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
{ Error: Cannot find module './build/default/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:438:15)
    at Function.Module._load (module.js:386:25)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/liyanfeng/blog/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/liyanfeng/blog/node_modules/bunyan/lib/bunyan.js:79:18)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/liyanfeng/blog/node_modules/hexo-log/lib/log.js:3:14)
    at Module._compile (module.js:541:32) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/Debug/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:438:15)
    at Function.Module._load (module.js:386:25)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/liyanfeng/blog/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/liyanfeng/blog/node_modules/bunyan/lib/bunyan.js:79:18)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/liyanfeng/blog/node_modules/hexo-log/lib/log.js:3:14)
    at Module._compile (module.js:541:32) code: 'MODULE_NOT_FOUND' }

@pod4g pod4g changed the title from 升级Node.js 6.0.0之后无法编译 to 升级Node.js v6.0.0之后无法编译 May 3, 2016

@ludo237

This comment has been minimized.

Show comment
Hide comment
@ludo237

ludo237 May 4, 2016

Can confirm same error with NodeJs v6.0.0

hexo: 3.2.0
hexo-cli: 1.0.1
os: Darwin 15.4.0 darwin x64
http_parser: 2.7.0
node: 6.0.0
v8: 5.0.71.35
uv: 1.9.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 48
openssl: 1.0.2g

ludo237 commented May 4, 2016

Can confirm same error with NodeJs v6.0.0

hexo: 3.2.0
hexo-cli: 1.0.1
os: Darwin 15.4.0 darwin x64
http_parser: 2.7.0
node: 6.0.0
v8: 5.0.71.35
uv: 1.9.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 48
openssl: 1.0.2g
@pod4g

This comment has been minimized.

Show comment
Hide comment
@pod4g

pod4g May 5, 2016

My hexo version info :

hexo-cli: 1.0.1
os: Darwin 15.4.0 darwin x64
http_parser: 2.7.0
node: 6.0.0
v8: 5.0.71.35
uv: 1.9.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 48
openssl: 1.0.2g

@ludo237

I use node version manage module which named n to back to v5.8.0 and everything is ok.

I suggest that before the hexo fix this issue you can do this

pod4g commented May 5, 2016

My hexo version info :

hexo-cli: 1.0.1
os: Darwin 15.4.0 darwin x64
http_parser: 2.7.0
node: 6.0.0
v8: 5.0.71.35
uv: 1.9.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 48
openssl: 1.0.2g

@ludo237

I use node version manage module which named n to back to v5.8.0 and everything is ok.

I suggest that before the hexo fix this issue you can do this

@lixplor

This comment has been minimized.

Show comment
Hide comment
@lixplor

lixplor May 5, 2016

@pod4g I changed back to v5.8.0 but still has this issue:

➜  blog hexo
[Error: Module version mismatch. Expected 47, got 48.]
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }

My hexo info:

hexo: 3.2.0
hexo-cli: 1.0.1
os: Darwin 15.4.0 darwin x64
http_parser: 2.6.2
node: 5.8.0
v8: 4.6.85.31
uv: 1.8.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 47    <-- Is this the problem? How to update this version?
openssl: 1.0.2g

I found 2 workarounds below but neither of them works:

  1. https://hexo.io/docs/troubleshooting.html#Error-with-DTrace-Mac-OS-X
  2. http://kikoroc.com/2016/05/04/resolve-hexo-DTraceProviderBindings-MODULE-NOT-FOUND.html

lixplor commented May 5, 2016

@pod4g I changed back to v5.8.0 but still has this issue:

➜  blog hexo
[Error: Module version mismatch. Expected 47, got 48.]
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }

My hexo info:

hexo: 3.2.0
hexo-cli: 1.0.1
os: Darwin 15.4.0 darwin x64
http_parser: 2.6.2
node: 5.8.0
v8: 4.6.85.31
uv: 1.8.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 47    <-- Is this the problem? How to update this version?
openssl: 1.0.2g

I found 2 workarounds below but neither of them works:

  1. https://hexo.io/docs/troubleshooting.html#Error-with-DTrace-Mac-OS-X
  2. http://kikoroc.com/2016/05/04/resolve-hexo-DTraceProviderBindings-MODULE-NOT-FOUND.html
@Xuanwo

This comment has been minimized.

Show comment
Hide comment
@Xuanwo

Xuanwo May 6, 2016

Contributor

Hexo do not pass node 6 's tests now.

Contributor

Xuanwo commented May 6, 2016

Hexo do not pass node 6 's tests now.

@pod4g

This comment has been minimized.

Show comment
Hide comment
@pod4g

pod4g May 6, 2016

@fantasymaker-cn you can try this #1274. good luck .

pod4g commented May 6, 2016

@fantasymaker-cn you can try this #1274. good luck .

@ludo237

This comment has been minimized.

Show comment
Hide comment
@ludo237

ludo237 May 6, 2016

@Xuanwo no problemo. Any ETA on nodev6 support?

ludo237 commented May 6, 2016

@Xuanwo no problemo. Any ETA on nodev6 support?

@lixplor

This comment has been minimized.

Show comment
Hide comment
@lixplor

lixplor May 6, 2016

@pod4g Oops...no luck. I tried but still got error:

{ [Error: Cannot find module './build/Release/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Release/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }

lixplor commented May 6, 2016

@pod4g Oops...no luck. I tried but still got error:

{ [Error: Cannot find module './build/Release/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Release/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
@pod4g

This comment has been minimized.

Show comment
Hide comment
@pod4g

pod4g May 7, 2016

@fantasymaker-cn I haven't met this problem , but I found this problem is very common by search on google .. if you solve this problem finally, please Tell me

pod4g commented May 7, 2016

@fantasymaker-cn I haven't met this problem , but I found this problem is very common by search on google .. if you solve this problem finally, please Tell me

@Artwalk

This comment has been minimized.

Show comment
Hide comment
@Artwalk

Artwalk May 8, 2016

I reinstalled hexo-cli

npm uninstall hexo-cli -g
npm install hexo-cli -g

hexo s is missing and hexo g shows:

ERROR Process failed: layout/.DS_Store
TypeError: Cannot read property 'compile' of undefined
hexo: 3.2.0
hexo-cli: 1.0.1
os: Darwin 15.4.0 darwin x64
http_parser: 2.7.0
node: 6.1.0
v8: 5.0.71.35
uv: 1.9.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 48
openssl: 1.0.2h

Artwalk commented May 8, 2016

I reinstalled hexo-cli

npm uninstall hexo-cli -g
npm install hexo-cli -g

hexo s is missing and hexo g shows:

ERROR Process failed: layout/.DS_Store
TypeError: Cannot read property 'compile' of undefined
hexo: 3.2.0
hexo-cli: 1.0.1
os: Darwin 15.4.0 darwin x64
http_parser: 2.7.0
node: 6.1.0
v8: 5.0.71.35
uv: 1.9.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 48
openssl: 1.0.2h
@cielpy

This comment has been minimized.

Show comment
Hide comment
@cielpy

cielpy May 9, 2016

same errors

ERROR Process failed: layout/.DS_Store
TypeError: Cannot read property 'compile' of undefined

hexo: 3.2.0
hexo-cli: 1.0.1
os: Darwin 15.4.0 darwin x64
http_parser: 2.5.2
node: 4.4.4
v8: 4.5.103.35
uv: 1.8.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 46
openssl: 1.0.2h

cielpy commented May 9, 2016

same errors

ERROR Process failed: layout/.DS_Store
TypeError: Cannot read property 'compile' of undefined

hexo: 3.2.0
hexo-cli: 1.0.1
os: Darwin 15.4.0 darwin x64
http_parser: 2.5.2
node: 4.4.4
v8: 4.5.103.35
uv: 1.8.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 46
openssl: 1.0.2h

@Xuanwo

This comment has been minimized.

Show comment
Hide comment
@Xuanwo

Xuanwo May 10, 2016

Contributor

@Artwalk @cielpy you need skip_render the .DS_Store

Contributor

Xuanwo commented May 10, 2016

@Artwalk @cielpy you need skip_render the .DS_Store

@Artwalk

This comment has been minimized.

Show comment
Hide comment
@Artwalk

Artwalk May 10, 2016

OK, but how?

Which file can configure to skip it?

On May 10, 2016, at 10:31 AM, 漩涡 notifications@github.com wrote:

@Artwalk https://github.com/Artwalk @cielpy https://github.com/cielpy you need skip_render the .DS_Store


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #1939 (comment)

Artwalk commented May 10, 2016

OK, but how?

Which file can configure to skip it?

On May 10, 2016, at 10:31 AM, 漩涡 notifications@github.com wrote:

@Artwalk https://github.com/Artwalk @cielpy https://github.com/cielpy you need skip_render the .DS_Store


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #1939 (comment)

@Xuanwo

This comment has been minimized.

Show comment
Hide comment
@Xuanwo

Xuanwo May 10, 2016

Contributor

@Artwalk edit the _config.yml may solve this problem.

Contributor

Xuanwo commented May 10, 2016

@Artwalk edit the _config.yml may solve this problem.

@cielpy

This comment has been minimized.

Show comment
Hide comment
@cielpy

cielpy May 10, 2016

skip_render option?this option can skip folder,how to skip files,every subfolder has a .DS_Store file.

cielpy commented May 10, 2016

skip_render option?this option can skip folder,how to skip files,every subfolder has a .DS_Store file.

@cielpy

This comment has been minimized.

Show comment
Hide comment
@cielpy

cielpy May 10, 2016

I just delete all .DS_Store files recursive,use this command
find ./ -name ".DS_Store" -depth -exec rm {} \; from https://helpx.adobe.com/dreamweaver/kb/remove-ds-store-files-mac.html
Just works temporarily.

cielpy commented May 10, 2016

I just delete all .DS_Store files recursive,use this command
find ./ -name ".DS_Store" -depth -exec rm {} \; from https://helpx.adobe.com/dreamweaver/kb/remove-ds-store-files-mac.html
Just works temporarily.

@feivorid

This comment has been minimized.

Show comment
Hide comment
@feivorid

feivorid May 19, 2016

change the stable version

feivorid commented May 19, 2016

change the stable version

@leesei

This comment has been minimized.

Show comment
Hide comment
@leesei

leesei May 23, 2016

Member

".DS_Store" is another known issue #1855 for Hexo 3.2.

Member

leesei commented May 23, 2016

".DS_Store" is another known issue #1855 for Hexo 3.2.

@eppfel

This comment has been minimized.

Show comment
Hide comment
@eppfel

eppfel May 31, 2016

I had the original error @pod4g described. I could resolve it by updating xcode dependencies (opened xcode and it prompted to do so), reinstalling hexo-cli and updating node to v6.2.0.

eppfel commented May 31, 2016

I had the original error @pod4g described. I could resolve it by updating xcode dependencies (opened xcode and it prompted to do so), reinstalling hexo-cli and updating node to v6.2.0.

@leesei

This comment has been minimized.

Show comment
Hide comment
@leesei

leesei Jun 16, 2016

Member

You have to rebuild modules with native code/dependency after Node upgrade, as indicated by Module version mismatch. Expected 48, got 47.

npm rebuild hexo

Reinstalling works too:

rm -rf node_modules/
npm i --no-optional
Member

leesei commented Jun 16, 2016

You have to rebuild modules with native code/dependency after Node upgrade, as indicated by Module version mismatch. Expected 48, got 47.

npm rebuild hexo

Reinstalling works too:

rm -rf node_modules/
npm i --no-optional
@LeekinGTA

This comment has been minimized.

Show comment
Hide comment
@LeekinGTA

LeekinGTA Jun 16, 2016

hexo update?

LeekinGTA commented Jun 16, 2016

hexo update?

@Xuanwo Xuanwo closed this Jul 2, 2016

@lixplor

This comment has been minimized.

Show comment
Hide comment
@lixplor

lixplor Jul 10, 2016

I solved this by adding sudo permission when installing: $ sudo npm install hexo --no-optional

lixplor commented Jul 10, 2016

I solved this by adding sudo permission when installing: $ sudo npm install hexo --no-optional

@Markakd

This comment has been minimized.

Show comment
Hide comment
@Markakd

Markakd Nov 30, 2016

@leesei Your solution worked for me!

Markakd commented Nov 30, 2016

@leesei Your solution worked for me!

@pobusama

This comment has been minimized.

Show comment
Hide comment
@pobusama

pobusama Dec 31, 2016

Just reinstall your package from npm:
rm -rf node_modules && npm install
http://blog.jonathanargentiero.com/node-js-error-module-version-mismatch-expected-48-got-46/

pobusama commented Dec 31, 2016

Just reinstall your package from npm:
rm -rf node_modules && npm install
http://blog.jonathanargentiero.com/node-js-error-module-version-mismatch-expected-48-got-46/

@Anastasmloza

This comment has been minimized.

Show comment
Hide comment
@Anastasmloza

Anastasmloza Sep 4, 2017

I find that I can install it with npm install hexo
But I can not install it with npm install hexo -g
So, I just go to the global catalog(Mine is /root/Cache/NPM/.npm-global/lib/node_modules) and install it with npm install hexo
And then add the bin catalog of hexo to the environment path.
Hope this works for you

Anastasmloza commented Sep 4, 2017

I find that I can install it with npm install hexo
But I can not install it with npm install hexo -g
So, I just go to the global catalog(Mine is /root/Cache/NPM/.npm-global/lib/node_modules) and install it with npm install hexo
And then add the bin catalog of hexo to the environment path.
Hope this works for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment