npm安装nodelua问题

发布于 2022-09-02 01:47:30 字数 10609 浏览 25 评论 0

sudo npm install nodelua --registry=http://registry.npm.taobao.org

\

nodelua@0.3.3 install /home/game/testlua/lua/node_modules/nodelua
node-gyp rebuild

make:进入目录'/home/game/testlua/lua/node_modules/nodelua/build'
CXX(target) Release/obj.target/nodelua/src/utils.o
../src/utils.cc: In function ‘char* get_str(v8::Local<v8::Value>)’:
../src/utils.cc:6:5: error: ‘ThrowException’ is not a member of ‘v8’

 v8::ThrowException(v8::Exception::TypeError(v8::String::New("Argument Must Be A String")));
 ^

../src/utils.cc:6:49: error: ‘New’ is not a member of ‘v8::String’

 v8::ThrowException(v8::Exception::TypeError(v8::String::New("Argument Must Be A String")));
                                             ^

../src/utils.cc: In function ‘v8::Local<v8::Value> lua_to_value(lua_State*, int)’:
../src/utils.cc:20:81: error: no matching function for call to ‘v8::Boolean::New(int)’

 return v8::Local<v8::Boolean>::New(v8::Boolean::New((int)lua_toboolean(L, i)));
                                                                             ^

../src/utils.cc:20:81: note: candidate is:
In file included from /home/game/.node-gyp/0.12.4/src/node.h:61:0,

             from ../src/utils.h:5,
             from ../src/utils.cc:2:

/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:6183:17: note: static v8::Handle<v8::Boolean> v8::Boolean::New(v8::Isolate*, bool)
Handle<Boolean> Boolean::New(Isolate* isolate, bool value) {

             ^

/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:6183:17: note: candidate expects 2 arguments, 1 provided
../src/utils.cc:23:73: error: no matching function for call to ‘v8::Number::New(lua_Number)’

 return v8::Local<v8::Number>::New(v8::Number::New(lua_tonumber(L, i)));
                                                                     ^

../src/utils.cc:23:73: note: candidate is:
In file included from /home/game/.node-gyp/0.12.4/src/node.h:61:0,

             from ../src/utils.h:5,
             from ../src/utils.cc:2:

/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
static Local<Number> New(Isolate* isolate, double value);

                    ^

/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: candidate expects 2 arguments, 1 provided
../src/utils.cc:26:12: error: ‘New’ is not a member of ‘v8::String’

 return v8::String::New((char *)lua_tostring(L, i));
        ^

../src/utils.cc:30:51: error: no matching function for call to ‘v8::Object::New()’

   v8::Local<v8::Object> obj = v8::Object::New();
                                               ^

../src/utils.cc:30:51: note: candidate is:
In file included from /home/game/.node-gyp/0.12.4/src/node.h:61:0,

             from ../src/utils.h:5,
             from ../src/utils.cc:2:

/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:2388:24: note: static v8::Local<v8::Object> v8::Object::New(v8::Isolate*)
static Local<Object> New(Isolate* isolate);

                    ^

/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:2388:24: note: candidate expects 1 argument, 0 provided
../src/utils.cc:42:56: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’

 return v8::Local<v8::Primitive>::New(v8::Undefined());
                                                    ^

In file included from /home/game/.node-gyp/0.12.4/src/node.h:61:0,

             from ../src/utils.h:5,
             from ../src/utils.cc:2:

/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here
friend Handle<Primitive> Undefined(Isolate* isolate);

                        ^

../src/utils.cc: In function ‘void push_value_to_lua(lua_State*, v8::Handle<v8::Value>)’:
../src/utils.cc:49:62: error: no matching function for call to ‘v8::Local<v8::Value>::New(v8::Handle<v8::Value>&)’

 lua_pushstring(L, get_str(v8::Local<v8::Value>::New(value)));
                                                          ^

../src/utils.cc:49:62: note: candidates are:
In file included from /home/game/.node-gyp/0.12.4/src/node.h:61:0,

             from ../src/utils.h:5,
             from ../src/utils.cc:2:

/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:368:29: note: static v8::Local v8::Local::New(v8::Isolate*, v8::Handle) [with T = v8::Value]
V8_INLINE static Local New(Isolate* isolate, Handle that);

                         ^

/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:368:29: note: candidate expects 2 arguments, 1 provided
/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:369:29: note: static v8::Local v8::Local::New(v8::Isolate*, const v8::PersistentBase&) [with T = v8::Value]
V8_INLINE static Local New(Isolate* isolate,

                         ^

/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:369:29: note: candidate expects 2 arguments, 1 provided
/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:391:29: note: static v8::Local v8::Local::New(v8::Isolate, T) [with T = v8::Value]
V8_INLINE static Local New(Isolate isolate, T that);

                         ^

/home/game/.node-gyp/0.12.4/deps/v8/include/v8.h:391:29: note: candidate expects 2 arguments, 1 provided
../src/utils.cc: In function ‘v8::Local<v8::Value> lua_to_value(lua_State*, int)’:
../src/utils.cc:45:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
make: * [Release/obj.target/nodelua/src/utils.o] 错误 1
make:离开目录“/home/game/testlua/lua/node_modules/nodelua/build”
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:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.13.0-32-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/game/testlua/lua/node_modules/nodelua
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Linux 3.13.0-32-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "nodelua" "--registry=http://registry.npm.taobao.org"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! code ELIFECYCLE

npm ERR! nodelua@0.3.3 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodelua@0.3.3 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the nodelua 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 nodelua
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/game/testlua/lua/npm-debug.log

-------- 以下是我ubuntu14上的node及其它工具的版本
game@games ~/t/lua> node -v
v0.10.41
game@games ~/t/lua> npm -v
1.4.29
game@games ~/t/lua> lua -v
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
game@games ~/t/lua>
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/usr/lib/python2.7/lib-dynload/readline.x86_64-linux-gnu.so", 2);
import readline # dynamically loaded from /usr/lib/python2.7/lib-dynload/readline.x86_64-linux-gnu.so

我的问题是同样是这些环境我在另外两台电脑上安装的好好的都是一次性安装好,到新机子上反而遇到这个讨厌的V8问题
../src/utils.cc:6:5: error: ‘ThrowException’ is not a member of ‘v8’

 v8::ThrowException(v8::Exception::TypeError(v8::String::New("Argument Must Be A String")));

make: * [Release/obj.target/nodelua/src/utils.o] 错误 1
make:离开目录“/home/game/testlua/lua/node_modules/nodelua/build”
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:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.13.0-32-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/game/testlua/lua/node_modules/nodelua
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Linux 3.13.0-32-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "nodelua" "--registry=http://registry.npm.taobao.org"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! code ELIFECYCLE

npm ERR! nodelua@0.3.3 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodelua@0.3.3 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the nodelua 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 nodelua
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/game/testlua/lua/npm-debug.log

如有人遇到与本人同样的问题,请多多指教。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

時窥 2022-09-09 01:47:30

好像v8一次很激进的升级后,原先的c++ addons就不能用了。node0.8以前的版本应该是ok的,新版本就编译不过了。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文