Tag: node gyp

如何在“node-gyp rebuild”中声明“'NewInstance'已被弃用”警告? v8中NewInstance的替代select是什么?

你好V8程序员和节点gyp'ers。 我正在运行OS X 10.12.6 ,使用npm v3.10.10 , nan v2.6.2 , gcc作为XCode的一部分使用此版本输出运行的Node v6.11.1 : $ > gcc –version Configured with: –prefix=/Applications/Xcode.app/Contents/Developer/usr –with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.7.0 Thread model: posix 请帮我理解如何正确使用NewInstance并消除在我的自定义软件包安装的npm install或node-gyp rebuild过程中的警告? > node-gyp rebuild CXX(target) Release/obj.target/cellcrypt/src/cellcrypt.o CC(target) Release/obj.target/cellcrypt/src/decode.o CXX(target) Release/obj.target/cellcrypt/src/DecryptionWrapper.o ../src/DecryptionWrapper.cpp:55:44: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations] v8::Local<v8::Object> instance = cons->NewInstance(); ^ /Users/sjcbsolo/.node-gyp/6.11.1/include/node/v8.h:3276:52: […]

使用C ++插件的节点应用程序在运行时抱怨未定义的符号

我有一个NodeJS应用程序,它可以调用一些本地插件来实现一些OpenCV调用。 node-gyp build命令成功,但每次我尝试运行与node app服务器我得到: Error: /home/cmaccess/SfMLocalization/VisionLocalizeServer/build/Release/localizeImage.node: undefined symbol: _ZNK2cv9Feature2D5emptyEv at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at bindings (/home/cmaccess/SfMLocalization/VisionLocalizeServer/node_modules/bindings/bindings.js:76:44) at Object.<anonymous> (/home/cmaccess/SfMLocalization/VisionLocalizeServer/routes/localize.js:28:37) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) 我不能,为了我的生活,弄清楚为什么会这样。 我检查了一个已知的很好的修订版,并重新安装了OpenCV。 我甚至没有在任何代码中明确使用cv::Feature2D ! 有没有人有什么可能会导致这个未定义的符号错误的build议?

Windows 10 node-gyp无法构build:MSBUILD失败,退出代码1

Windows 10,Microsoft Visual Studio 2013,Node v0.12.7,node-gyp v2.0.2 我总是得到node-gyp的错误生成错误: Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1 另外在红色的颜色描述: Could not write lines to file "Release\obj\validation\validation.tlog\validation.lastbuildstate". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 […]

将Node.js模块中的Boost与node-gyp链接起来

我试图创build一个node.js加载项,它是一个简单的包装来访问Boost库项目中的perl正则expression式。 我正在运行OSX 10.9.2,而且我也不是一个c ++开发人员,所以工具不熟悉。 我的项目如下所示 boost.cc #include <node.h> #include <v8.h> #include <boost/regex.hpp> using namespace v8; Handle<Value> Match(const Arguments& args) { HandleScope scope; if (args.Length() < 2) { ThrowException(Exception::TypeError(String::New("Wrong number of arguments"))); return scope.Close(Undefined()); } if (!args[0]->IsString()) { ThrowException(Exception::TypeError(String::New("Regex agrument 1 must be a string"))); return scope.Close(Undefined()); } if (!args[1]->IsString()) { ThrowException(Exception::TypeError(String::New("Target agrument 2 must be […]

将一个x86 C dll符号包装到nodejs javascript中

我有一个用mingw gcc工具链(32位)编译的dll。 我想把一个符号包装到一个javascript函数中。 我做了下面的代码: binding.gyp { "targets": [ { "target_name": "hellomod", "sources": [ "hellomod.cc" ], "include_dirs": [ "<!(node -e \"require('nan')\")" ], "libraries": [ "C:\\juan\\repos\\sandbox\\node\\dll_module\\hello_lib\\hello.lib" ] } ] } hellomod.cc #include <nan.h> extern "C" { __declspec( dllimport ) void hello(char *name); } using namespace v8; NAN_METHOD(Method) { NanScope(); hello("Juan"); NanReturnValue(String::New("Hello world")); } void Init(Handle<Object> exports) { […]

使用纯JS的node.js中的XML转换?

我一直在试图find一个基于node.js的XML转换工具,以取代使用msxsl.exe或mono-xmltool.exe。 我曾尝试在Win8 x64上使用node.js 0.12安装gulp-xslt和xsl-transform。 但是,由于“node_xslt”和“node-gyp”中的错误而导致无法安装。 gyp ERR! configure error gyp ERR! stack Error: spawn C:\tools\pyhton2 ENOENT gyp ERR! stack at exports._errnoException (util.js:746:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1046:32) gyp ERR! stack at child_process.js:1137:20 gyp ERR! stack at process._tickCallback (node.js:355:11) gyp ERR! System Windows_NT 6.3.9600 gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd C:\test\node_modules\xsl-transform\node_modules\node_xslt […]

node-gyp不被识别为内部或外部命令,可操作程序或batch file

我正在尝试为Node.js创buildC ++插件。 我正在按照这个教程,并坚持使用node-gyp configure命令。 正如我从这里理解,我应该创buildbinding.gyp文件,并从该目录运行node-gyp configure ,但我得到“node-gyp不被识别为内部或外部命令,可操作的程序或batch file”错误。 Node-gyp是使用npm install -g node-gyp 。 这肯定是一件容易的事,但我是Node.js的新手,不知道什么是错的。 这是我想要实现的一个例子: http : //luismreis.github.io/node-bindings-guide/docs/getting-started.html

node-gyp重build失败:找不到ares.h文件

升级node-gyp rebuild后,我的系统上的nodejs版本从0.10.37升级到了0.12.5,在我使用的一个npm软件包失败之后。 它给出一个错误“ares.h”文件没有find。 这是我build立它时得到的错误 CXX(target) Release/obj.target/ancillary/src/ancillary.o In file included from ../src/ancillary.cc:4: In file included from /Users//.node-gyp/0.12.2/src/stream_wrap.h:25: /Users//.node-gyp/0.12.2/src/env.h:25:10: fatal error: 'ares.h' file not found #include "ares.h" ^ 1 error generated. make: *** [Release/obj.target/ancillary/src/ancillary.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/node-gyp/lib/build.js:269:23) gyp […]

如何交叉编译ARM的node-gyp

我创build了一个需要从C程序中创build一个节点模块的节点应用程序。我使用SWIG(简单包装接口生成器)来做到这一点,我得到了节点模块。应用程序运行在我的PC上成功运行。我现在想交叉编译我的应用程序运行在Beaglebone Black.I上运行这个命令: node-gyp –arch=arm configure 它工作得很好,但是当我运行时: node-gyp build 我得到这个消息: module.js:356 Module._extensions[extension](this, filename); ^ Error: /home/user/a/build/Release/example.node: cannot open shared object file: No such file or directory at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/home/user/a/app.js:21:8) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) […]

在Windows 7 64位上安装浏览器同步时出错

我在我的系统上安装了node-gyp和Python 2.7 现在我可以安装socket.io (我不是没有安装Python 2.7),但我仍然无法使用npm install -g browser-sync 我真的不知道如何解决错误,请指导 谢谢 这是我的npm config ls -l ; cli configs long = true user-agent = "npm/2.6.1 node/v1.4.3 win32 x64" ; userconfig C:\Users\Admin\.npmrc python = "c:\\tools\\python2" ; builtin config undefined prefix = "C:\\Users\\Admin\\AppData\\Roaming\\npm" ; default values access = null always-auth = false bin-links = true browser = null ca […]