问题标签 [node-gyp]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2124 浏览

c++ - C++:线程构建块 - 包括地狱

我无法编译我的 C++ 程序。如您所见,我正在编写一个 Node.js 插件。这是代码(Eamorr_addon.cpp):

当我删除线路时,一切正常#include "tbb/concurrent_hash_map.h"

这是我的 gyp 制作文件:

当我这样做时node-gyp build,我得到以下我无法深入了解的错误流:

任何人都可以提出任何建议吗?


编辑:

这是“Rk.h”:

这是“Definitions.h”:

0 投票
1 回答
1802 浏览

node.js - 在 Centos 5 上安装 Node.js 时出错:包需要 GYP

我正在尝试通过包管理器在 Centos 5 上安装 NODE.JS,如https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager中所述

但不幸的是,在“yum install nodejs-compat-symlinks npm”期间,我收到错误消息:

我该如何解决这个问题?

谢谢!

0 投票
1 回答
1212 浏览

windows - 在 windows 上编译的 node-expat 但找不到模块

https://github.com/TooTallNate/node-expat/tree/gyp和 node-gyp 用于编译它。生成了 node_expat.node。在代码中引用时出现以下错误:

我无法进一步尝试在 Windows 上获取 node-expat。感谢任何输入。

0 投票
1 回答
1104 浏览

node.js - 如何使用 node-gyp 根据节点版本有条件地为 node.js 编译本机代码?

我有一些针对 node.js 模块的 C++ 代码,它是为 node 0.8 及其增强的 libuv 编写的。具体来说,我正在使用 uv_mutex_* 函数,这些函数在节点 0.6 中包含的 libuv 中不存在。我想有条件地嵌入这些函数的 pthreads 等价物,但仅限于在旧版本上构建时。

在节点 0.8 上构建时,这应该给我一个跨平台构建(Windows 和 Linux),如果节点版本是 0.6,它应该给我一个正常运行的 Linux 版本。

节点版本是否有预处理器#define?我找不到一个。我能想到的最好的办法是在 binding.gyp 中做一些笨拙的事情,以尝试根据 <@(node_root) 猜测版本,并​​以某种方式将其按摩为“定义”值。肯定有更好的办法!

0 投票
2 回答
6101 浏览

node.js - 为 node.js 使用 sqlite 模块时遇到问题

[我试图包含更多链接以使我的问题更清楚,但 stackoverflow 不允许我这样做,因为我没有 10 个声望点。]

我有 node.js,现在我想为它选择一个 sqlite 模块,我的选择是:orlandov/node-sqlite、developmentseed/node-sqlite3 和 grumdrig/node-sqlite。我删除了 grumdrig,因为只支持同步访问。

当我尝试按照他们的指示探索 developmentseed 时,我遇到了这个问题:

所以我尝试使用 npm install (也建议)并遇到这个问题:

当我尝试使用 npm

我遇到了这个问题(即使使用 sudo 并更改所有者/权限):

我查看了 stackoverflow 的:Node.js : NPM Install FailsNodejs + Node-Sqlite3 Installation Problem以及许多其他链接,但还没有找到解决方案。

我也无法通过 orlandov 配置 node-sqlite。

我只是想玩弄 node-sqlite(通过 orlandov)和 node-sqlite3(通过 developmentseed),所以我可以选择更好的,但被困在这里。

哦,我也在 github 上查看了 node-gyp -- /TooTallNate/node-gyp/ 但它似乎也需要 npm。

对于如何构建这些和/或在 developmentseed 和 orlandov 之间使用哪些建议,我将不胜感激。

0 投票
1 回答
1648 浏览

windows - 使用 npm 安装 postgres 时出现问题

我在我的 Windows 机器上通过 npm安装pg时遇到问题。

它抱怨 python,但我已将 python 添加为 env。多方面的变数都无济于事。

这些都是我尝试声明环境的所有方式。变种。

  • C:/Program Files/Python
  • "C:/Program Files/Python"
  • C:/Program Files/Python/python.exe
  • "C:/Program Files/Python/python.exe"

这是错误:

0 投票
2 回答
5486 浏览

node.js - Contextify@0.1.3 install: `node-gyp rebuild` failed with 1

I tried to npm install jquery and it failed when trying to install one of it's dependencies, Contextify. So I tried to npm install contextify and got this error. I haven't been able to find a solution after about an hour or so of looking online. I keep getting close but not close enough. My node.js is running on Ubuntu 12.04, and as you can see in my code, node.js is version 0.8.11. Here is the error when trying to npm install jquery:

And the error for npm install contextify:

Any help is greatly appreciated. :)

UPDATE

I've read that problems come if python is not installed or if a gcc compiler is not installed. I have both of those installed. I followed these instructions for the gcc compiler, and python 2.7 comes with Ubuntu 12.04. So I'm still researching. :)

0 投票
1 回答
624 浏览

node.js - node-gyp 配置总是因 EXDEV 错误而失败

我正在尝试编译以下 MWE,基本上取自官方 Node.js 文档

对应binding.gyp文件如下:

当我尝试运行时node-gyp configure,我收到以下错误:

我正在运行 64 位版本的 Fedora 17。这是输出uname -a

以下是更多系统信息:

在此先感谢您的帮助。

0 投票
1 回答
206 浏览

node.js - Node-gyp 生成非 Node.js 项目?

可以node-gyp用来生成非 Node.js 插件项目吗?

例如,我想用它node-gyp来生成一个典型的“Hello, World!”。C++ 项目。我可以这样做吗?我该怎么做?我发现股票 python GYP 文档缺少我正在寻找的示例和描述。

0 投票
1 回答
329 浏览

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

我从 NodeJS 核心(加密)中获取了一段简单的代码:

但是,node-gyp在我自己的本机扩展中编译它时,我收到以下错误:

知道是什么原因造成的吗?