Tag: node gyp

node-gyp:gyp ERR! 无法加载共享的libpython2.7.so.1.0

我正在尝试为节点js构buildhello world c ++插件。 node.js和node-gyp似乎都已成功安装到redhat linux中。 但是当我运行“node-gyp configure”时,它给出了以下错误。 我没有通过gooling和wiki页面获得任何有见地的信息。 你能恳请build议吗? 我从源代码构build了Python并进行了自定义安装。 下面是libpython2.7.so.1.0:$ PYTHONPATH以及$ LD_LIBRARY_PATH。 节点或节点gypsearch一个相当不同的环境可以共享库吗? 提前致谢。 堆栈错误: ~/examples/node.js/my_node_addon-1[13:14]% node-gyp configure gyp info it worked if it ends with ok gyp info using node-gyp\@0.10.10 gyp info using node\@0.10.18 | linux | x64 gyp ERR! configure error gyp ERR! stack Error: Command failed: python: error while loading […]

在使用node-gyp构build时,无法将nodeJS本机C ++插件链接到与节点(0.10.18)静态绑定的OpenSSL

我读过这个: https : //github.com/TooTallNate/node-gyp/wiki/Linking-to-OpenSSL ,但由于某种原因,它不适合我。 当我试图要求从节点的插件时,我得到“未定义的符号:SHA1”。 这是我的代码( src/sha_export.cc ): #include <node.h> #include <node_buffer.h> #include <v8.h> #include <openssl/sha.h> using namespace v8; Handle<Value> Sha1(const Arguments& args) { HandleScope scope; if (args.Length() < 1) { ThrowException(Exception::TypeError(String::New("Wrong number of arguments"))); return scope.Close(Undefined()); } unsigned char*msg = (unsigned char*) node::Buffer::Data(args[0]->ToObject()); size_t msglen = node::Buffer::Length(args[0]->ToObject()); unsigned char dgst[20]; SHA1(msg, msglen, dgst); […]

错误:未定义符号:仅在使用node-gyp进行编译时,omp_init_lock

我正在尝试编译一个使用外部库的c ++插件。 我的bindings.gyp文件如下所示: { "targets": [ { "target_name": "addon", "sources": [ "addon.cc" ], "include_dirs": [ "<!(node -e \"require('nan')\")" ], "libraries":[ "/home/ubuntu/workspace/libdds.a" ], } ] } 当我尝试使用node-gyp进行编译时,它编译得很好,但在运行时出现以下错误: Error: /home/ubuntu/workspace/build/Release/addon.node: undefined symbol: omp_init_lock at Error (native) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object.<anonymous> (/home/ubuntu/workspace/addon.js:1:75) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) […]

跟踪器:错误TRK0005:无法find:“CL.exe”

我觉得我已经尝试了一切。 我已经安装和卸载了每个单一版本的Visual Studio(从2010年到2017年) 我试图安装用于windows c ++的构build工具 我已经卸载node.js并重新安装。 但是不pipe我做什么我仍然得到错误: TRACKER : error TRK0005: Failed to locate: "CL.exe". 我已经尝试了每一个“解决scheme”,我可以findgoogle讨论或描述这个问题。 当我运行npm install 我得到以下错误: TRACKER : error TRK0005: Failed to locate: "CL.exe". file not found gyp ERR! build error gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23) gyp […]

C ++仿真来自节点的int main(int argc,char * argv )

基本上我正在使用他们的NAPIfunction来将现有的C ++文件与我们的javascript / node进行整合。 我有一个testingC ++文件工作,所以我知道我的设置工作。 但是,在实际的C ++文件中,它被devise为从命令行使用argc和argv从命令行运行。 基本上我只需要从其他函数内部调用C ++的主要方法,这意味着没有命令行。 所以我必须传递argc和argv的值。 argc只是一个int,这很容易,但argc是char **types,从我的研究看来,它是一个字符数组又名string的数组? 这是我的C ++文件底部的当前代码 void Init(Env env, Object exports, Object module) { exports.Set("main", Function::New(env, main(2,{"test","test2"}))); } NODE_API_MODULE(addon, Init) argc值工作正常 我想创build一个临时/testing值为argv传入,但我有一个问题搞清楚如何使我的价值观typeschar **数组。

node-gyp在关于不兼容types的基本Buffer :: Length操作上崩溃

我已经从NodeJS核心(encryption)取了一段简单的代码: ASSERT_IS_BUFFER(args[0]); ssize_t klen = Buffer::Length(args[0]); 但是,在我自己的本地扩展中编译node-gyp时,出现以下错误: ../deps/v8/include/v8.h:202:5: error: assigning to 'v8::Object *volatile' from incompatible type 'v8::Value *' TYPE_CHECK(T, S); ^ ../deps/v8/include/v8.h:145:37: note: expanded from macro 'TYPE_CHECK' *(static_cast<T* volatile*>(0)) = static_cast<S*>(0); \ ^ ../src/openssljs.cc:300:33: note: in instantiation of function template specialization 'v8::Handle<v8::Object>::Handle<v8::Value>' requested here ssize_t klen = Buffer::Length(args[0]); ^ 任何想法可能是什么原因造成的?

有没有办法在node-gyp命令行上指定编译器标志(例如,预处理器macros定义)?

我正在尝试将Node.js插件集成到基于CMake的现有构build系统中。 插件构build需要CMake上下文中提供的大量预处理器macros定义和库依赖项。 我希望能够通过CMake调用时将这些传递给node-gyp 。 不幸的是,我还没有find一个简单的方法来做到这一点。 我试过使用这种普通的旧gyp的方法: node-gyp configure -d -DPOSIX=1 但-D选项似乎没有被node-gyp传递。 查看node-gyp的源代码,这并不令人惊讶。 有没有一种直接的,直接的方式来做到这一点,或者我坚持以编程方式在binding.gyp生成条目,从环境或其他方面提取这些信息?

如何为msbuild.exe指定附加的包含目录

我正在尝试安装nodejs模块ibm_db。 我遇到的问题是,为了安装这个模块node-gyp需要使用msbuild来构build它,但是它不会检测到我已经安装的一些头文件。 如何将我的附加头文件的目录添加到某个path,以便在试图编译任何项目时,msbuild.exe能够find它们? 在Linux上,我只是简单地设置cpath =并且一切都很好。 谢谢!

错误:找不到:make

我无法安装任何需要node-gyp软件包。 错误消息是这样的 $ npm install node-protobuf 信息尝试registry请求尝试1在22:43:57 http GET https://registry.npmjs.org/node-protobuf http 200 https://registry.npmjs.org/node-protobuf npm http GET https://registry.npmjs.org/node-protobuf/-/node-protobuf-1.0.8.tgz npm http 200 https://registry.npmjs.org/node-protobuf/-/node-protobuf-1.0.8.tgz > node-protobuf@1.0.8 install / home / whs / node_modules / node-protobuf > node-gyp重build gyp ERR! build立错误 gyp ERR! 堆栈错误:找不到:make gyp ERR! 在F堆栈(/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28) gyp ERR! 在E堆栈(/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29) gyp ERR! 在/usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16处堆叠 gyp ERR! 在Object.oncomplete(fs.js:107:15) gyp ERR! 系统Linux […]

检测GYP中的MSVC版本

我正在尝试在我的binding.gyp文件中的node-gyp configure期间检测msvc版本。 基本上,我想能够链接到特定的基于Visual C ++版本的第三方库: ['OS=="win"' and 'toolset="vc12"' , { 'libraries': [ "opencv/lib/vc12/opencv_world300.lib" ], }], ['OS=="win"' and 'toolset="vc11"' , { 'libraries': [ "opencv/lib/vc11/opencv_world300.lib" ], }], ['OS=="win"' and 'toolset="vc10"' , { 'libraries': [ "opencv/lib/vc10/opencv_world300.lib" ], }] 遗憾的是, _toolset没有定义toolset ,也没有_toolset甚至$(TOOLSET)variables。 在GYP文档中我找不到这样的variables。 有没有可能?