nodejieba icon indicating copy to clipboard operation
nodejieba copied to clipboard

nodejieba 安装失败

Open bolerovt opened this issue 8 years ago • 5 comments

mac 安装 nodejieba 失败,不知道是版本问题还是其他什么问题?

server:project user$ npm install nodejieba --save

> [email protected] install /Users/project/node_modules/nodejieba
> node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
2017-08-23 10:58:08.883 xcodebuild[90817:25417443] [MT] PluginLoading: Required plug-in compatibility UUID DFFB3951-EB0A-4C09-9DAC-5F2D28CC839C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/VVDocumenter-Xcode.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2017-08-23 10:58:08.883 xcodebuild[90817:25417443] [MT] PluginLoading: Required plug-in compatibility UUID DFFB3951-EB0A-4C09-9DAC-5F2D28CC839C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMQuickHelp.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2017-08-23 10:58:08.883 xcodebuild[90817:25417443] [MT] PluginLoading: Required plug-in compatibility UUID DFFB3951-EB0A-4C09-9DAC-5F2D28CC839C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
  CXX(target) Release/obj.target/nodejieba/lib/index.o
/Users/project/node_modules/.bin/touch: line 1: XSym: command not found
/Users/project/node_modules/.bin/touch: line 2: 0021: command not found
/Users/project/node_modules/.bin/touch: line 3: 2134d080adbde5d6d2d2ef49081309c9: command not found
/Users/project/node_modules/.bin/touch: line 4: ../touch/bin/touch.js: No such file or directory
make: *** [Release/obj.target/nodejieba/lib/index.o] Error 127
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:285: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:215:12)
gyp ERR! System Darwin 16.7.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/project/node_modules/nodejieba
gyp ERR! node -v v6.10.2
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/Users/project /node_modules/duplexify/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/project/node_modules/fsevents/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/project/node_modules/mquery/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/project/node_modules/readdirp/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/project/node_modules/fsevents/node_modules/dashdash/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/project/node_modules/fsevents/node_modules/node-pre-gyp/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/project/node_modules/fsevents/node_modules/rc/package.json'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install 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!     /Users/user/.npm/_logs/2017-08-23T02_58_12_963Z-debug.log

bolerovt avatar Aug 23 '17 03:08 bolerovt

我也遇到了

> [email protected] install /Users/doyee/workspace/node/Liaoru/node_modules/nodejieba
> node-gyp rebuild

  CXX(target) Release/obj.target/nodejieba/lib/index.o
/Users/doyee/workspace/node/Liaoru/node_modules/.bin/touch: line 1: syntax error near unexpected token `('
/Users/doyee/workspace/node/Liaoru/node_modules/.bin/touch: line 1: `var touch = require("../touch")'
make: *** [Release/obj.target/nodejieba/lib/index.o] Error 2
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/doyee/.nvm/versions/node/v8.9.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 16.0.0
gyp ERR! command "/Users/doyee/.nvm/versions/node/v8.9.3/bin/node" "/Users/doyee/.nvm/versions/node/v8.9.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/doyee/workspace/node/Liaoru/node_modules/nodejieba
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

nbwsc avatar Jan 31 '18 03:01 nbwsc

是否可以提供预编译的版本?npm 业界一般都是使用 https://github.com/mapbox/node-pre-gyp 来实现预编译,这样使用者本地就不需要安装编译环境依赖了。

fengmk2 avatar Nov 19 '18 11:11 fengmk2

我也遇到第一种情况

ghost avatar Feb 09 '19 12:02 ghost

> [email protected] install /Users/Diluka/parsec/game-0030/node_modules/nodejieba
> node-gyp rebuild

  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:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:22:1: warning: 'ToBoolean' is deprecated: ToBoolean can never throw. Use Local version. [-Wdeprecated-declarations]
X(Boolean)
^
../../nan/nan_converters_43_inl.h:18:12: note: expanded from macro 'X'
      val->To ## TYPE(isolate->GetCurrentContext())                            \
           ^
<scratch space>:91:1: note: expanded from here
ToBoolean
^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:2567:3: note: 'ToBoolean' has been explicitly marked deprecated here
  V8_DEPRECATED("ToBoolean can never throw. Use Local version.",
  ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:40:1: warning: 'BooleanValue' is deprecated: BooleanValue can never throw. Use Isolate version. [-Wdeprecated-declarations]
X(bool, Boolean)
^
../../nan/nan_converters_43_inl.h:37:15: note: expanded from macro 'X'
  return val->NAME ## Value(isolate->GetCurrentContext());                     \
              ^
<scratch space>:98:1: note: expanded from here
BooleanValue
^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:2605:3: note: 'BooleanValue' has been explicitly marked deprecated here
  V8_DEPRECATED("BooleanValue can never throw. Use Isolate version.",
  ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:103:42: error: no viable conversion from 'v8::Isolate *' to 'Local<v8::Context>'
  return scope.Escape(v8::Function::New( isolate
                                         ^~~~~~~
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:183:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'v8::Isolate *' to 'const v8::Local<v8::Context> &' for
      1st argument
class Local {
      ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:183:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'v8::Isolate *' to 'v8::Local<v8::Context> &&' for 1st
      argument
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:187:13: note: candidate template ignored: could not match 'Local<type-parameter-0-0>' against 'v8::Isolate *'
  V8_INLINE Local(Local<S> that)
            ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:4171:22: note: passing argument to parameter 'context' here
      Local<Context> context, FunctionCallback callback,
                     ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:337:37: error: too few arguments to function call, expected 2, have 1
  return v8::StringObject::New(value).As<v8::StringObject>();
         ~~~~~~~~~~~~~~~~~~~~~      ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:5426:3: note: 'New' declared here
  static Local<Value> New(Isolate* isolate, Local<String> value);
  ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:337:58: error: expected '(' for function-style cast or type construction
  return v8::StringObject::New(value).As<v8::StringObject>();
                                         ~~~~~~~~~~~~~~~~^
../../nan/nan_implementation_12_inl.h:337:60: error: expected expression
  return v8::StringObject::New(value).As<v8::StringObject>();
                                                           ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
../../nan/nan.h:1034:44: error: no matching member function for call to 'ToString'
      v8::Local<v8::String> string = from->ToString();
                                     ~~~~~~^~~~~~~~
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:2572:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:2588:31: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided
                Local<String> ToString(Isolate* isolate) const);
                              ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
../../nan/nan.h:1044:37: error: cannot initialize a parameter of type 'v8::Isolate *' with an lvalue of type 'char *'
        length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
                                    ^~~~
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:2782:26: note: passing argument to parameter 'isolate' here
  int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
                         ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
../../nan/nan.h:1818:28: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    New(persistentHandle)->Set(New(key).ToLocalChecked(), value);
                           ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:3402:3: note: 'Set' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version",
  ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
../../nan/nan.h:1824:28: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    New(persistentHandle)->Set(key, value);
                           ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:3402:3: note: 'Set' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version",
  ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
../../nan/nan.h:1830:28: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    New(persistentHandle)->Set(index, value);
                           ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:3411:3: note: 'Set' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version",
  ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
../../nan/nan.h:1836:32: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
        New(persistentHandle)->Get(New(key).ToLocalChecked()));
                               ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:3457:3: note: 'Get' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", Local<Value> Get(Local<Value> key));
  ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
../../nan/nan.h:1842:48: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
    return scope.Escape(New(persistentHandle)->Get(key));
                                               ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:3457:3: note: 'Get' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", Local<Value> Get(Local<Value> key));
  ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
../../nan/nan.h:1847:48: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
    return scope.Escape(New(persistentHandle)->Get(index));
                                               ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:3461:3: note: 'Get' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", Local<Value> Get(uint32_t index));
  ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
In file included from ../../nan/nan.h:2657:
../../nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(persistent().IsNearDeath());
           ~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
In file included from ../../nan/nan.h:2657:
../../nan/nan_object_wrap.h:67:18: warning: 'MarkIndependent' is deprecated: Weak objects are always considered independent. Use TracedGlobal when trying to use EmbedderHeapTracer. Use a strong handle when trying to keep an
      object alive. [-Wdeprecated-declarations]
    persistent().MarkIndependent();
                 ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:563:3: note: 'MarkIndependent' has been explicitly marked deprecated here
  V8_DEPRECATED(
  ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
In file included from ../lib/utils.h:6:
In file included from ../../nan/nan.h:2657:
../../nan/nan_object_wrap.h:124:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(wrap->handle_.IsNearDeath());
           ~~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
../lib/utils.h:19:14: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
      array->Set(i, Nan::New<v8::String>(ov[i].c_str()).ToLocalChecked());
             ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8.h:3411:3: note: 'Set' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version",
  ^
/Users/Diluka/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../lib/index.cpp:1:
In file included from ../lib/nodejieba.h:4:
../lib/utils.h:26:5: error: use of undeclared identifier 'Handle'
    Handle<v8::Object> obj = Nan::New<v8::Object>();
    ^
../lib/utils.h:26:22: error: expected '(' for function-style cast or type construction
    Handle<v8::Object> obj = Nan::New<v8::Object>();
           ~~~~~~~~~~^
../lib/utils.h:26:24: error: use of undeclared identifier 'obj'
    Handle<v8::Object> obj = Nan::New<v8::Object>();
                       ^
../lib/utils.h:31:5: error: use of undeclared identifier 'obj'
    obj->Set(k, v);
    ^
../lib/utils.h:34:5: error: use of undeclared identifier 'obj'
    obj->Set(k, v);
    ^
../lib/utils.h:35:19: error: use of undeclared identifier 'obj'
    array->Set(i, obj);
                  ^
../lib/utils.h:42:5: error: use of undeclared identifier 'Handle'
    Handle<v8::Object> obj = Nan::New<v8::Object>();
    ^
../lib/utils.h:42:22: error: expected '(' for function-style cast or type construction
    Handle<v8::Object> obj = Nan::New<v8::Object>();
           ~~~~~~~~~~^
../lib/utils.h:42:24: error: use of undeclared identifier 'obj'
    Handle<v8::Object> obj = Nan::New<v8::Object>();
                       ^
../lib/utils.h:47:5: error: use of undeclared identifier 'obj'
    obj->Set(k, v);
    ^
../lib/utils.h:50:5: error: use of undeclared identifier 'obj'
    obj->Set(k, v);
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
10 warnings and 20 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:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.0.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/Diluka/parsec/game-0030/node_modules/nodejieba
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/nodejieba):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

Diluka avatar Oct 31 '19 09:10 Diluka

use 2.3.3 resolved

Diluka avatar Oct 31 '19 09:10 Diluka