Tag: node gyp

如何在node.js依赖树中find本地模块?

我有一个node.js应用程序与约10直接依赖关系,导致总共50依赖关系。 我现在想知道这些依赖关系中是否有任何一个使用本地代码 (当然除了node.js平台本身),比如外部系统库(其他项目中使用过libxml),拥有C / C ++库,需要安装编译器的nod​​e-gyp构build脚本等。 有没有一种简单/快速的方法来检查给定模块的整个依赖树对于这种情况?

在Windows 7上的节点失败

============================== 已解决:从节点4.0.0切换到0.12.7。 Node v4.0.0似乎是相当原始的 我读过很多文章,他们没有帮助我。 任何解决方法? 我已经在Windows 7上安装了Visual Studio Express 2013,并set GYP_MSVS_VERSION=2013 。 但是在npm install我仍然得到了与socket.io依赖相关的以下错误: error C2995: 'v8::Local<T> _NanEnsureLocal(v8::Local<T>)' : function template error C3083: 'smalloc': the symbol to the left of a '::' must be a type [ error C2039: 'FreeCallback' : is not a member of 'node' [ error C2061: syntax error : identifier […]

即使从package.json中删除,node-gyp也会尝试构build依赖项

我是新来的节点,但遇到一个奇怪的问题。 让我概述我的步骤: 安装具有fabric依赖关系的项目,而这依赖于名为contextify的旧包。 这个项目也使用node-gyp来安装插件。 运行npm install ,失败时为: contextify@0.1.15 install / path / to / project / node_modules / contextify 节点gyp重build CXX(target)Release / obj.target / contextify / src / contextify.o …. ../src/contextify.cc:150:16:错误:在'v8 :: ObjectTemplate'中没有名为'SetAccessCheckCallbacks'的成员 otmpl-> SetAccessCheckCallbacks(GlobalPropertyNamedAccessCheck, ~~~~~ ^ … Googling otmpl->SetAccessCheckCallbacks(GlobalPropertyNamedAccessCheck,给出了一些链接( node-gyp , fabric ),说明这是节点版本的一个已知问题,我有节点7.4,这需要节点6或更早。 我意识到这个项目实际上并没有使用fabric ,所以我从package.json删除了依赖项 我删除了我的node_modules文件夹,然后再次运行npm install 。 同样的错误。 现在出现了怪异的部分: npm install (调用node-gyp rebuild […]

如何包含c ++库,使node-gyp可以链接?

我正在编写nodejs代码,并希望使用node-gyp来编译C ++代码(包含'mysql / mysql.h'的backend.cpp)。 我在build立时遇到这个错误: module.js:356模块。 扩展名[extension](this,filename); ^错误: ____ /build/Release/backend.node:undefined符号:mysql_init 谁能帮忙? 我如何指示node-gyp将mysql.h链接到目标backend.node?

相当于Python ctypes和node-gyp的javascript

我想将一个python脚本转换成一个javascript脚本。 我的Python脚本加载一个DLL并使用其API。 processings2D = ctypes.CDLL('processings2D.dll') print(processings2D.ImageProcessor2DCreate()) 我尝试做与node-gyp相同,但我的脚本没有find该DLL。 console.log(processings2D.ImageProcessor2DCreate()); ^ TypeError: Cannot load processings2D.dll library test.js var processings2D = require('./build/Release/processings2D.node'); console.log(processings2D.ImageProcessor2DCreate()); addon.cc #include <nan.h> #include "processings2D/processings2D.h" HINSTANCE hDLL = NULL; typedef int(*Fn)(); void ImageProcessor2DCreate(const Nan::FunctionCallbackInfo<v8::Value>& info) { hDLL = LoadLibrary("processings2D.dll"); if(!hDLL) { Nan::ThrowTypeError("Cannot load processings2D.dll library"); return; } Fn fn = (Fn)GetProcAddress(hDLL, "ImageProcessor2DCreate"); if (!fn) { […]

如何在npm项目中findnode-gyp依赖(..或任何依赖)

我正在经历难以想象的挫折,试图让一个项目运行(即通过调用“npm install” ),总是跳过node-gyp 。 我在Windows上,所以我需要安装Python和类似Visual Studio的东西。 长话短说…我不想依赖于像Visual Studio那样的一堆烂堆,所以我想看看这个node-gyp是否可以以某种方式成为可选的,或者被删除掉。 现在,如果我打开我的package.json文件,我发现这些依赖关系。 "devDependencies": { "autoprefixer-stylus": "^0.7.1", "browser-sync": "^2.8.2", "gulp": "^3.9.0", "gulp-cache": "^0.3.0", "gulp-concat": "^2.6.0", "gulp-if": "^1.2.5", "gulp-imagemin": "^2.3.0", "gulp-minify-html": "^1.0.4", "gulp-nunjucks-html": "^1.2.2", "gulp-order": "^1.1.1", "gulp-plumber": "^1.0.1", "gulp-stylus": "^2.0.6", "gulp-uglify": "^1.2.0", "gulp-util": "^3.0.6", "jeet": "^6.1.2", "kouto-swiss": "^0.11.13", "minimist": "^1.1.3", "rupture": "^0.6.1" }, "dependencies": { "gulp-install": "^0.6.0" } 我可以在这里看到每个包的依赖关系树: http://npm.anvaka.com/#/ […]

找不到Python可执行文件“/path/to/executable/python2.7”,可以设置PYTHON envvariables

bufferutil@1.2.1 install /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/bufferutil> node- gyp rebuild gyp ERR! configuration错误gyp ERR! 堆栈错误:找不到Python可执行文件“/path/to/executable/python2.7”,可以设置PYTHON envvariables 。 gyp ERR! 堆栈在failNoPython(/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14)gyp ERR! 堆栈在/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 gyp ERR! 在F堆栈(/usr/lib/node_modules/npm/node_modules/which/which.js:78:16)gyp ERR! 在E堆栈(/usr/lib/node_modules/npm/node_modules/which/which.js:82:29)gyp ERR! 堆栈在/usr/lib/node_modules/npm/node_modules/which/which.js:93:16 gyp ERR! 堆栈在FSReqWrap.oncomplete(fs.js:82:15)gyp ERR! 系统Linux 3.13.0-74-generic gyp ERR! 命令“/ usr / bin / nodejs”“/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js”“rebuild”gyp ERR! cwd /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/bufferutil gyp ERR! node -v v5.3.0 gyp ERR! node-gyp -v v3.2.1 gyp ERR! 不行npm […]

安装nodeBB时,发现node-gyp rebuild status 1问题

我正在尝试安装开源论坛系统之一的nodeBB。 当我尝试在这个github页面运行命令。 我得到了下面的错误信息, > mmmagic@0.3.15 install /Users/tyler/Work/forum/NodeBB/node_modules/mmmagic > node-gyp rebuild gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: EPERM, utime '/Users/tyler/.node-gyp/0.12.7' gyp ERR! stack at Error (native) gyp ERR! System Darwin 14.4.0 gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/tyler/Work/forum/NodeBB/node_modules/mmmagic gyp ERR! node -v […]

Printf语句不能在lambda上工作

我试图用node.js创build一个lambda函数 w用C代码编写代码,并使用node-gyp将其转换为节点库。 lambda函数完美的工作。 但是它仅打印node.js console.log语句。 这是我的node.js代码 'use strict'; console.log('Loading function'); exports.handler = (event, context, callback) => { var addon = require('./build/Release/testLibraryfromCcode'); addon.sayHello(); console.log("Completed"); } 这是我的C代码 int sayHello() { printf("Haaaaaaaaaaaaai\n"); fflush(stdout); return 0; } 我从lambdatesting控制台得到这样的输出 TART RequestId: 3e8cd5ff-2d41-11e6-af8f-ada8f1249113 Version: $LATEST 2016-06-08T06:21:32.779Z 3e8cd5ff-2d41-11e6-af8f-ada8f1249113 Loading function 2016-06-08T06:21:32.779Z 3e8cd5ff-2d41-11e6-af8f-ada8f1249113 Completed Haaaaai打印缺失。 我需要在我的C代码中打印printf语句。 如果有任何想法?

为什么在Mac OSX El Capitan上node-gyp重build失败

我最近买了一台使用Mac OSX El Capitan v10.11.4的Mac。 安装节点与自制软件,并使用节点v6.2.2和npm v3.9.5。 我在npm install过程中遇到了bcrypt错误,我相信这是从node-gyp rebuild错误导致的。 我最近还下载了xcode-select(版本2343)和xcode(7.3.1)(按此顺序)。 在运行npm install之后,以下是完整的错误输出: https://gist.github.com/varunjayaraman/5734af617d616437cd5b3456b20bc503 不知道发生了什么问题。 我来自linux的土地,并倾向于从源头上安装自己,所以也许这是这些问题的原因? 无论如何,任何意见将超级赞赏。 我也看到了这个错误,但他们的解决scheme似乎没有任何工作(当我键入xcode-select –print-path打印xcode-select –print-path ,我得到/Applications/Xcode.app/Contents/Developer )