Skip to content
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

Cannot find module './build/Release/nodejieba.node' #1

Closed
tianshuo opened this issue Jun 22, 2016 · 4 comments
Closed

Cannot find module './build/Release/nodejieba.node' #1

tianshuo opened this issue Jun 22, 2016 · 4 comments

Comments

@tianshuo
Copy link

nodejieba 1.0.3 node 6.2.1 CLI version: 2.3.0 GitBook version: 3.1.1

When using gitbook serve
PluginError: Error with plugin "search-jieba": Cannot find module './build/Release/nodejieba.node'

@007pig
Copy link
Owner

007pig commented Jun 22, 2016

I believe it's a gitbook's bug. After you run gitbook install, please also run npm rebuild in the book dir. In this way, the native code of nodejieba will be compiled.

@tianshuo
Copy link
Author

tianshuo commented Jun 22, 2016

New errors after npm rebuild

(node:48114) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

> nodejieba@2.2.1 install /Users/tianshuo/sources/docs/node_modules/nodejieba
> node-gyp rebuild

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  CXX(target) Release/obj.target/nodejieba/lib/index.o
  CXX(target) Release/obj.target/nodejieba/lib/nodejieba.o
  SOLINK_MODULE(target) Release/nodejieba.node

> nodejieba@1.4.2 install /Users/tianshuo/sources/docs/node_modules/gitbook-plugin-search-pro/node_modules/nodejieba
> node-gyp rebuild

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  CXX(target) Release/obj.target/nodejieba/lib/index.o
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
../node_modules/nan/nan.h:602:20: error: no type named 'GCEpilogueCallback' in
      'v8::Isolate'
      v8::Isolate::GCEpilogueCallback callback
      ~~~~~~~~~~~~~^
../node_modules/nan/nan.h:608:20: error: no type named 'GCEpilogueCallback' in
      'v8::Isolate'
      v8::Isolate::GCEpilogueCallback callback) {
      ~~~~~~~~~~~~~^
../node_modules/nan/nan.h:613:20: error: no type named 'GCPrologueCallback' in
      'v8::Isolate'
      v8::Isolate::GCPrologueCallback callback
      ~~~~~~~~~~~~~^
../node_modules/nan/nan.h:619:20: error: no type named 'GCPrologueCallback' in
      'v8::Isolate'
      v8::Isolate::GCPrologueCallback callback) {
      ~~~~~~~~~~~~~^
4 errors generated.
make: *** [Release/obj.target/nodejieba/lib/index.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Darwin 15.2.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/tianshuo/sources/docs/node_modules/gitbook-plugin-search-pro/node_modules/nodejieba
gyp ERR! node -v v6.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok

npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "rebuild"
npm ERR! node v6.2.1
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! nodejieba@1.4.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodejieba@1.4.2 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the nodejieba package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls nodejieba
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/tianshuo/sources/docs/npm-debug.log

@007pig
Copy link
Owner

007pig commented Jun 22, 2016

Looks like you have mac. you need to install XCode to compile the module.

@tianshuo
Copy link
Author

Looks like this bug: nodejs/node-gyp#569

@007pig 007pig closed this as completed Jun 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants