Giter Site home page Giter Site logo

nodejs / node-gyp Goto Github PK

View Code? Open in Web Editor NEW
9.7K 265.0 1.8K 5.13 MB

Node.js native addon build tool

License: MIT License

JavaScript 10.40% Python 88.14% C++ 0.09% Shell 0.06% Emacs Lisp 0.84% Batchfile 0.01% C# 0.46%
node-gyp gyp node-addon nodejs node

node-gyp's Issues

gyp requires newer python version

I'm not sure what version exactly that gyp requires now, but at least on OSX 10.6 with Python 2.6.1, I get a syntax error that points to the beginning of my binding.gyp file. I installed Python 2.7.3 to a separate directory and used it with node-gyp instead, which worked just fine.

I also tested on 2.7.2 and 2.7.3 on Linux and Windows without issues. So maybe it requires Python >= 2.7 now or ?

Q: Is there a way to work with native dependencies?

I am trying to come up with a way to add include and library paths from a native extension that is an npm dependency of the package to the generated makefile. The use case is as follows: I'd like to create a binding for libxmlsec1 but, given that its API operates with libxml2 objects, I'd like to reuse the binding for libxml2 already provided by libxmljs. In order to do that and avoid copying source files physically I need to somehow figure out where npm put libxmljs and inject proper dependencies into the makefile. With waf, I could always resort to Python hackery -- any ideas how can this be done in gyp?

Add 'configure', 'build' and 'clean' hooks.

For more complex module build systems, like node-ffi, where the bundled libffi also needs to be configured and built, there should be hooks into the build steps for modules. The hooks should be node JavaScript files and will need to manually take care of platform differences in their scripts.

I'm thinking that these should be hard-coded script names (i.e. gyp-configure.js, gyp-build.js, and gyp-clean.js) which would be run if they exist, before the rest of the step.

add "-C dir, --directory=dir" switch

Like make(1). From the man page:

Change to directory dir before reading the makefiles or doing anything else.
$ node-gyp -C node_modules/pty.js rebuild

Generated target.mk file discards ldflags on OSX, but not Ubuntu

On an Ubuntu dev server of mine, node-gyp will generate a project.target.mk file that contains my specified ldflags. The same binding.gyp file does not seem to generate a .mk file containing the -L parameter that I am passing to ldflags.

The binding.gyp file looks like this:

{
    'targets': [
        {
            'target_name': 'hdfs',
            'variables': {
                'java_home': '<!(echo $JAVA_HOME)',
                'hadoop_home': '<!(echo $HADOOP_HOME)'
            },
            'include_dirs': [
                '<(java_home)/include',
                '<(hadoop_home)/src/c++/libhdfs'
            ],
            'sources': [
                'src/module.cc',
                'src/hdfs.cc'
            ],
            'link_settings': {
                'libraries': [
                    '-lhdfs'
                ],
                'ldflags': [
                    '-L<(hadoop_home)/c++/Linux-amd64-64/lib'
                ]
            }
        }
    ]
}

The project.target.mk file created, in the build directory, is missing the -L that I've specified, on OSX Lion. I do not know if this is something that I am incorrectly doing with gyp in general, or if this is a node-gyp issue. I just wanted to bring this up here incase it's a node-gyp issue. Also, I'm still trying to figure out how to specify that -L in ldflags on my Macbook. :/

Complexity concern

I don't like to stir things up, but I'm concerned that this is building layers of complexity on top of something that should be really simple and, more than anything, needs to be completely transparent to the developer.

All I really want to be able to do is to do

gyp (some options I understand) mymodule.gyp

Perhaps a script can take away the need to add the options. This node-gyp seems to be going more into the direction of being an autotools - which has the superficial allure of being super-intelligent and automatic, but in fact makes things harder because everything becomes that bit more obscure for the developer, and the only build options I get are the ones that the tool chose to give me, instead of the ones that are supported by the underlying utilities.

Already looking at this I don't know, wlthout looking in detail, whether or not I can use the xcode generator; or what options it can and cannot pass to gyp, for example. Or what option to give it to see exactly what gyp command is being generated, or to see what the complete compiler/linker commands are.

Added to all of that, we still have the issue that gyp itself is not mature, and you often end up having to debug gyp when you first try to do something new. That becomes a lot harder when you're trying to tell it what to do from the other side of this stack.

$Configuration should be $ConfigurationName

On my system when configuring a solution it creates a vcproj with $(Configuration) instead of $(ConfigurationName) in the path for the node.lib, which causes the build to fail with warning "PRJ0018: ... environment variables not found ..." and an empty replacement for that .e.g. ..\node.lib instead of ...\Release\node.lib .

Replacing the variable name in the vcproj works correctly so there must be some kind of error or difference.

PS: This was done with [email protected]

Add regression tests

Hi Nate,

I wanted to offer to help you set up a pull request bot to prevent regressions against typical builds. If you can spin up an EC2/Joyent machine I help you configure the scripts for this bot:

http://github.com/arturadib/botio

It's all written in Node and easy to deploy/maintain.

It'd be helpful to have something like that in place here so that our builds don't regress (or at least regress in a controllable fashion :)) with newer versions.

Try to guess the location of 'python' on Windows...

... when not found in the PATH.

Just like we're doing for the msbuild command...

Python v2.7.2 by default gets installed to C:\Python27. So we should probably glob for C:\Python*, sort, then use the last match (as to try and get the latest version).

But we also need to make sure that it's not Python v3.x.x since that currently does not work with gyp.

Windows can't build Hello World example

Using MSVC++ Express on Windows 7, Python 2.7, node-gyp v0.1.3 (via npm -g).

Problem happens when trying to build a fresh copy of the Hello World addon from the Node-Gyp page.

The same Hello World example works out-of-the-box on OS X.

Problem 1

At first node-gyp seems to look for a bindings.gyp file rather than binding.gyp:

Z:\projs\node\gyp-hello-world\binding>node-gyp configure
info it worked if it ends with ok
info downloading: http://nodejs.org/dist/v0.6.0/node-v0.6.0.tar.gz
info downloading `node.lib` http://nodejs.org/dist/v0.6.10/node.lib
spawn python [ '.node-gyp\\0.6\\tools\\gyp_addon',
  '-Dnode_root_dir=.node-gyp\\0.6',
  '-I',
  '.node-gyp\\0.6\\tools\\patch.gypi',
  '-Dtarget_arch=ia32' ]
info done ok

Z:\projs\node\gyp-hello-world\binding>node-gyp build
info it worked if it ends with ok
spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe [ 'bindings.sln'
,
  '/clp:Verbosity=minimal',
  '/nologo',
  '/p:Configuration=Release' ]
MSBUILD : error MSB1009: Project file does not exist.
Switch: bindings.sln
ERR! Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed w
ith exit code: 1
    at Array.1 (C:\Users\Artur Adib\AppData\Roaming\npm\node_modules\node-gyp\li
b\build.js:118:25)
    at EventEmitter._tickCallback (node.js:192:40)
ERR! not ok

Problem 2

If I rename binding.gyp to bindings.gyp then it seems to build OK, except for a warning message concerning a mismatch of extensions (.dll vs .node):

Z:\projs\node\gyp-hello-world\bindings>node-gyp build
info it worked if it ends with ok
spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe [ 'bindings.sln'
,
  '/clp:Verbosity=minimal',
  '/nologo',
  '/p:Configuration=Release' ]
  binding.cc
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990
,5): warning MSB8012: TargetPath(Z:\projs\node\gyp-hello-world\bindings\Release\
binding.dll) does not match the Linker's OutputFile property value (Z:\projs\nod
e\gyp-hello-world\bindings\Release\binding.node). This may cause your project to
 build incorrectly. To correct this, please make sure that $(OutDir), $(TargetNa
me) and $(TargetExt) property values match the value specified in %(Link.OutputF
ile). [Z:\projs\node\gyp-hello-world\bindings\binding.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(991
,5): warning MSB8012: TargetExt(.dll) does not match the Linker's OutputFile pro
perty value (.node). This may cause your project to build incorrectly. To correc
t this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property
 values match the value specified in %(Link.OutputFile). [Z:\projs\node\gyp-hell
o-world\bindings\binding.vcxproj]
     Creating library Z:\projs\node\gyp-hello-world\bindings\Release\binding.lib
 and object Z:\projs\node\gyp-hello-world\bindings\Release\binding.exp
  Generating code
  Finished generating code
  binding.vcxproj -> Z:\projs\node\gyp-hello-world\bindings\Release\binding.dll
info done ok

Problem 3

Since the build was seemingly OK, I tried to run test.js, but it complains that there is no binary in ./out/Release/binding. Instead, the binary was produced in ./Release/binding.

Problem 4

Fixing the path issue above and running test.js again now leads to the following error:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: unknown error
    at Object..node (module.js:472:11)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at Object.<anonymous> (Z:\projs\node\gyp-hello-world\bindings\test.js:2:15)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)

I assume this is related to Problem 3 (.dll vs .node)?

Anyway, any help here is much appreciated.

Thanks Nate, for the superb tool.

Remove 'use' and 'current' commands, always configure the target in the 'configure' step

This is almost an extension of #19.

I'm thinking that the configure step should always be in charge of selecting the version of node to compile against. Currently, if there's already a version installed, and in use, then that will be the version used. But it seems bad to have to force the user to change the target version when a new version of node comes out.

So configure should always default to the current host version of node, unless a --target is specified. This is more like how node-waf worked so it's more intuitive, less of a cognitive switch on the users.

Add 'rebuild' command

Should be the equivalent of:

$ node-gyp clean || true; node-gyp configure && node-gyp build

[Windows 7(64bit) & Node 6.14] Error in building `bcrypt` gem

I installed Microsoft Visual Studio 2010 Express and python 2.7.2 and I am working in Windows.

The node-gyp configure command works successfully, however, node-gyp build fails on one of the node modules bcrypt.

The error log is shown below. Would it be a problem of source files? I am getting a lot of syntax errors.

>node-gyp configure

info it worked if it ends with ok
spawn python [ 'C:\\Users\\anderson\\.node-gyp\\0.6.14\\tools\\gyp_addon',
  'binding.gyp',
  '-IC:\\Users\\anderson\\node\\eduwrite\\node_modules\\bcrypt\\build\\config.gy
pi',
  '-f',
  'msvs',
  '-G',
  'msvs_version=2010' ]
info done ok

>node-gyp build

info it worked if it ends with ok
spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe [ 'build/binding
.sln',
  '/clp:Verbosity=minimal',
  '/nologo',
  '/p:Configuration=Release;Platform=Win32' ]
  blowfish.cc
  bcrypt.cc
  bcrypt_node.cc
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(66): error C2
146: syntax error : missing ';' before identifier 'S' [C:\Users\anderson\node\ed
uwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(66): error C4
430: missing type specifier - int assumed. Note: C++ does not support default-in
t [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(66): error C4
430: missing type specifier - int assumed. Note: C++ does not support default-in
t [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(67): error C2
146: syntax error : missing ';' before identifier 'P' [C:\Users\anderson\node\ed
uwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(67): error C4
430: missing type specifier - int assumed. Note: C++ does not support default-in
t [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(67): error C4
430: missing type specifier - int assumed. Note: C++ does not support default-in
t [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(76): error C2
061: syntax error : identifier 'u_int32_t' [C:\Users\anderson\node\eduwrite\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(77): error C2
061: syntax error : identifier 'u_int32_t' [C:\Users\anderson\node\eduwrite\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(79): error C4
430: missing type specifier - int assumed. Note: C++ does not support default-in
t [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(79): error C2
143: syntax error : missing ',' before '*' [C:\Users\anderson\node\eduwrite\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(81): error C4
430: missing type specifier - int assumed. Note: C++ does not support default-in
t [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(81): error C2
143: syntax error : missing ',' before '*' [C:\Users\anderson\node\eduwrite\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(85): error C4
430: missing type specifier - int assumed. Note: C++ does not support default-in
t [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(96): error C4
430: missing type specifier - int assumed. Note: C++ does not support default-in
t [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(96): error C2
143: syntax error : missing ',' before '*' [C:\Users\anderson\node\eduwrite\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(96): error C4
430: missing type specifier - int assumed. Note: C++ does not support default-in
t [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(99): error C2
065: 'u_int8_t' : undeclared identifier [C:\Users\anderson\node\eduwrite\node_mo
dules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(99): error C2
065: 'u_int8_t' : undeclared identifier [C:\Users\anderson\node\eduwrite\node_mo
dules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(99): error C2
059: syntax error : ',' [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\bui
ld\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(101): error C
2061: syntax error : identifier 'u_int8_t' [C:\Users\anderson\node\eduwrite\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(102): error C
2146: syntax error : missing ';' before identifier 'bcrypt_get_rounds' [C:\Users
\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(102): error C
4430: missing type specifier - int assumed. Note: C++ does not support default-i
nt [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj
]
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(102): error C
2086: 'int u_int32_t' : redefinition [C:\Users\anderson\node\eduwrite\node_modul
es\bcrypt\build\bcrypt_lib.vcxproj]
          c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(96)
 : see declaration of 'u_int32_t'
c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(102): error C
4430: missing type specifier - int assumed. Note: C++ does not support default-i
nt [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj
]
..\src\blowfish.cc(68): error C2061: syntax error : identifier 'u_int32_t' [C:\U
sers\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(70): error C2146: syntax error : missing ';' before identifie
r 'Xl' [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcx
proj]
..\src\blowfish.cc(70): error C2065: 'Xl' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(71): error C2146: syntax error : missing ';' before identifie
r 'Xr' [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcx
proj]
..\src\blowfish.cc(71): error C2065: 'Xr' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(72): error C2065: 's' : undeclared identifier [C:\Users\ander
son\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(72): error C2039: 'S' : is not a member of 'BlowfishContext'
[C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
          c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(65)
 : see declaration of 'BlowfishContext'
..\src\blowfish.cc(73): error C2065: 'p' : undeclared identifier [C:\Users\ander
son\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(73): error C2039: 'P' : is not a member of 'BlowfishContext'
[C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
          c:\users\anderson\node\eduwrite\node_modules\bcrypt\src\node_blf.h(65)
 : see declaration of 'BlowfishContext'
..\src\blowfish.cc(75): error C2065: 'Xl' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(75): error C2065: 'xl' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(76): error C2065: 'Xr' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(76): error C2065: 'xr' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(78): error C2065: 'Xl' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(78): error C2065: 'p' : undeclared identifier [C:\Users\ander
son\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(79): error C2065: 'Xr' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(79): error C2065: 's' : undeclared identifier [C:\Users\ander
son\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(79): error C2065: 'Xl' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(79): error C2065: 's' : undeclared identifier [C:\Users\ander
son\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]

.... a lot of similar errors.....

..\src\blowfish.cc(81): error C2065: 's' : undeclared identifier [C:\Users\ander
son\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(81): error C2065: 'Xr' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(81): error C2065: 's' : undeclared identifier..\src\bcrypt.cc
(52) : fatal error C1083: Cannot open include file: 'pwd.h': No such file or dir
-- More  -- ERR! Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.e
xe` failed with exit code: 1
    at Array.0 (C:\Users\anderson\AppData\Roaming\npm\node_modules\node-gyp\lib\
build.js:221:25)
    at EventEmitter._tickCallback (node.js:192:40)
ERR! not ok
ectory [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcx
proj]

..\src\blowfish.cc(81): error C2065: 'Xr' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(81): error C2065: 's' : undeclared identifier [C:\Users\ander
son\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(81): error C2065: 'Xr' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(81): error C2065: 's' : undeclared identifier [C:\Users\ander
son\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(81): error C2065: 'Xr' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(81): error C2065: 'p' : undeclared identifier [C:\Users\ander
son\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(82): error C2065: 'Xr' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(82): error C2065: 's' : undeclared identifier [C:\Users\ander
son\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(82): error C2065: 'Xl' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(82): error C2065: 's' : undeclared identifier [C:\Users\ander
son\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(82): error C2065: 'Xl' : undeclared identifier [C:\Users\ande
rson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\blowfish.cc(82): fatal error C1003: error count exceeds 100; stopping com
pilation [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_lib.v
cxproj]
C:\Users\anderson\.node-gyp\0.6.14\src\node_object_wrap.h(57): warning C4251: 'n
ode::ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interfac
e to be used by clients of class 'node::ObjectWrap' [C:\Users\anderson\node\eduw
rite\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
          with
          [
              T=v8::Object
          ]

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): war
ning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\build\bcrypt_li
b.vcxproj]
c:\users\anderson\.node-gyp\0.6.14\deps\openssl\openssl\include\openssl\../../e_
os2.h(56): fatal error C1083: Cannot open include file: 'openssl/opensslconf.h':
 No such file or directory [C:\Users\anderson\node\eduwrite\node_modules\bcrypt\
build\bcrypt_lib.vcxproj]

Support multiple commands at once: $ node-gyp configure build

It would be nice to be able to specify more than one command at one, and have node-gyp execute them serially.

Examples:

$ node-gyp configure build

# or

$ node-gyp clean configure build

This would be on-par with how node-waf used to do it so that would be nice :)

Overriding default flags

This is likely a question born of ignorance, but is there a way to override the default flags in common.gypi?

I need to compile with RTTI enabled but node-gyp defaults to -fno-rtti. This is required to compile against boost, for instance.

'node-gyp configure' uncaught exception

Hi. I am sitting in front of yet another machine today, trying to build node-sqlite3 with gyp.

So I have node 0.6.10 built & installed. And I did 'npm -g install node-gyp' with no error.

Now I unpack TooTallNate/node-sqlite3 and do this:

node-gyp clean // ok
node-gyp configure // error! See below...

info it worked if it ends with ok
info downloading: http://nodejs.org/dist/v0.6.0/node-v0.6.0.tar.gz
ERR! UNCAUGHT EXCEPTION:
ERR! TypeError: Object 0.6 has no method 'toFixed'
at downloadNodeLib (C:\Documents and Settings\cm\Application Data\npm\node_modules\node-gyp\lib\install.js:227:
49)
at Parse.afterTarball (C:\Documents and Settings\cm\Application Data\npm\node_modules\node-gyp\lib\install.js:1
68:9)
at Parse.emit (events.js:88:20)
at Parse._streamEnd (C:\Documents and Settings\cm\Application Data\npm\node_modules\node-gyp\node_modules\tar\l
ib\parse.js:64:6)
at BlockStream. (C:\Documents and Settings\cm\Application Data\npm\node_modules\node-gyp\node_module
s\tar\lib\parse.js:50:8)
at BlockStream.emit (events.js:64:17)
at BlockStream._emitChunk (C:\Documents and Settings\cm\Application Data\npm\node_modules\node-gyp\node_modules
\tar\node_modules\block-stream\block-stream.js:203:10)
at BlockStream.flush (C:\Documents and Settings\cm\Application Data\npm\node_modules\node-gyp\node_modules\tar
node_modules\block-stream\block-stream.js:70:8)
at BlockStream.end (C:\Documents and Settings\cm\Application Data\npm\node_modules\node-gyp\node_modules\tar\no
de_modules\block-stream\block-stream.js:66:8)
at Parse.end (C:\Documents and Settings\cm\Application Data\npm\node_modules\node-gyp\node_modules\tar\lib\pars
e.js:85:23)
ERR! This is a bug in node-gyp. Please open an Issue:
ERR! https://github.com/TooTallNate/node-gyp/issues
ERR! not ok

Error: UNKNOWN, unknown error with node-gyp rebuild

I'm getting an unknown error while trying to install contextify actually, but the npm log indicates the bug is in node-gyp. It goes like this :

$ npm install contextify
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings

> [email protected] install /Hookt/seao/node_modules/contextify
> node-gyp rebuild

info it worked if it ends with ok 
info downloading: http://nodejs.org/dist/v0.6.7/node-v0.6.7.tar.gz 
ERR! UNCAUGHT EXCEPTION:
ERR! Error: UNKNOWN, unknown error '/Users/renaudl/.node-gyp/0.6.7'
ERR! This is a bug in `node-gyp`. Please open an Issue:
ERR!   https://github.com/TooTallNate/node-gyp/issues
ERR! not ok

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the contextify 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 contextify
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Darwin 10.8.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "contextify"
npm ERR! cwd /test
npm ERR! node -v v0.6.7
npm ERR! npm -v 1.1.15
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: `node-gyp rebuild`
npm ERR! message `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /test/npm-debug.log
npm not ok

I'm pretty clueless here.

install fails as dependency

npm install jsdom


npm http GET https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/htmlparser
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/htmlparser
npm http 304 https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings

> [email protected] install /Users/jd/Documents/BB/transcoder/adapters/dicks-adapter/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild

info it worked if it ends with ok 
info downloading: http://nodejs.org/dist/v0.6.8/node-v0.6.8.tar.gz 
ERR! UNCAUGHT EXCEPTION:
ERR! Error: UNKNOWN, unknown error '/Users/jd/.node-gyp/0.6.8'
ERR! This is a bug in `node-gyp`. Please open an Issue:
ERR!   https://github.com/TooTallNate/node-gyp/issues
ERR! not ok
npm WARN optional dependency failed, continuing [email protected]
[email protected] ./node_modules/jsdom
β”œβ”€β”€ [email protected]
└── [email protected]

fail to compile in win32

C:\Program Files\nodejs\node_modules\contextify>python --version
Python 2.7.2

C:\Program Files\nodejs\node_modules\contextify>node -v
v0.6.7

C:\Program Files\nodejs\node_modules\contextify>node-gyp --version

Usage: node-gyp [options]

where is one of:
- build - Invokes msbuild and builds the module
- clean - Removes any generated build files and the "out" dir
- configure - Generates MSVC project files for the current module
- rebuild - Runs "clean", "configure" and "build" all at once
- install - Install node development files for the specified node version.
- list - Prints a listing of the currently installed node development files
- remove - Removes the node development files for the specified version

for specific command usage and options try:
$ node-gyp --help

[email protected] C:\Program Files\nodejs\node_modules\node-gyp

C:\Program Files\nodejs\node_modules\contextify>node-gyp configure
info it worked if it ends with ok
info downloading: http://nodejs.org/dist/v0.6.7/node-v0.6.7.tar.gz
ERR! Error: There was a fatal problem while downloading/extracting the tarball
at Extract.afterTarball (C:\Program Files\nodejs\node_modules\node-gyp\lib\install.js:178:19)
at Extract.emit (events.js:88:20)
at DirWriter. (C:\Program Files\nodejs\node_modules\tar\lib\extract.js:52:8)
at DirWriter.emit (events.js:88:20)
at C:\Program Files\nodejs\node_modules\tar\node_modules\fstream\lib\writer.js:293:8
at setProps (C:\Program Files\nodejs\node_modules\tar\node_modules\fstream\lib\writer.js:276:27)
at DirWriter._finish (C:\Program Files\nodejs\node_modules\tar\node_modules\fstream\lib\writer.js:184:5)
at DirWriter._process (C:\Program Files\nodejs\node_modules\tar\node_modules\fstream\lib\dir-writer.js:88:23)
at FileWriter.onend (C:\Program Files\nodejs\node_modules\tar\node_modules\fstream\lib\dir-writer.js:163:8)
at FileWriter.emit (events.js:88:20)
ERR! not ok

C:\Program Files\nodejs\node_modules\contextify>

Glob for the first .sln file during 'build'

Currently it defaults to bindings.sln, and you can specify a different solution file with the --solution=blah.sln flag.

A better user experience would be to glob for the first *.sln match and use that. Keep the --solution flag just in case, but it shouldn't really ever be needed for a properly structured node addon.

Default on building for the current host's architecture

Currently the target_arch variable gets set to ia32 by node's common.gypi file. This is fixed for v0.8.x but we will need to special-case 0.6 and 0.7, by specifying a -Dtarget_arch=x64 flag on the command line.

Additionally on OS X, the "make" generator hard-codes -arch i386 into the *.target.gyp.mk file. So on darwin, we will have to go through the generated .mk file (in the configure phase, after running gyp_addon), and strip the 4 lines containing the i386 entries.

node-gyp configure fails when run twice

Yeah, yeah, I probably shouldn't be running it twice. But when I do:

seth@lotus:~/src/JustinTulloss/zeromq.node [⚑ gyp] $ node-gyp configure --target=0.7
info it worked if it ends with ok 
spawn python [ '/Users/seth/.node-gyp/0.7/tools/gyp_addon',
  '-f',
  'make',
  '--suffix',
  '.gyp',
  '-I',
  '/Users/seth/.node-gyp/0.7/tools/patch2722.gypi',
  '-Dtarget_arch=ia32' ]
info done ok 
seth@lotus:~/src/JustinTulloss/zeromq.node [⚑ gyp] $ node-gyp configure --target=0.7
info it worked if it ends with ok 
spawn python [ '/Users/seth/.node-gyp/0.7/tools/gyp_addon',
  '-f',
  'make',
  '--suffix',
  '.gyp',
  '-I',
  '/Users/seth/.node-gyp/0.7/tools/patch2722.gypi',
  '-Dtarget_arch=ia32' ]
Traceback (most recent call last):
  File "/Users/seth/.node-gyp/0.7/tools/gyp_addon", line 22, in <module>
    rc = gyp.main(gyp_args)
  File "/Users/seth/.node-gyp/0.7/tools/gyp/pylib/gyp/__init__.py", line 471, in main
    options.circular_check)
  File "/Users/seth/.node-gyp/0.7/tools/gyp/pylib/gyp/__init__.py", line 111, in Load
    depth, generator_input_info, check, circular_check)
  File "/Users/seth/.node-gyp/0.7/tools/gyp/pylib/gyp/input.py", line 2270, in Load
    depth, check)
  File "/Users/seth/.node-gyp/0.7/tools/gyp/pylib/gyp/input.py", line 361, in LoadTargetBuildFile
    includes, True, check)
  File "/Users/seth/.node-gyp/0.7/tools/gyp/pylib/gyp/input.py", line 216, in LoadOneBuildFile
    None)
  File "Makefile.gyp", line 7
    MAKEFLAGS=-r
             ^
SyntaxError: invalid syntax
ERR! `gyp_addon` failed with exit code: 1
ERR! not ok

Trouble using node-gyp to build node-sqlite3 in Windows XP

TooTallNate,

Per your request on the Google group, I am logging this issue about the problem that I run into when I use the node-gyp to try to build the node-sqlite3 module.

First off, I download the node-sqlite3 gyp branch zip files and explode them into my c:\internet_download\TooTallNate_SQLite3 folder.

I have also installed the MS Visual C++ 2010 Express version and Python v 2.7.2 for Windows.

Then I cd to this directory and type in node-gyp configure.

It appears that it successfully builds the "build" directory.

Then when I type node-gyp build, the following error shows up. I think that this has something to do with the command issues by the build script.

C:\Internet_Download\TooTallNate_SQLite3>node-gyp build
info it worked if it ends with ok
spawn C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe [ 'build/bindings.sln',
'/clp:Verbosity=minimal',
'/nologo',
'/p:Configuration=Release' ]
C:\Internet_Download\TooTallNate_SQLite3\build\bindings.sln.metaproj : error MSB4126: The specified solution configuration "Release
|MCD" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe S
olution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration
. [C:\Internet_Download\TooTallNate_SQLite3\build\bindings.sln]
ERR! Error: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
at Array.0 (C:\Documents and Settings\Application Data\npm\node_modules\node-gyp\lib\build.js:139:25)
at EventEmitter._tickCallback (node.js:192:40)
ERR! not ok

However, when I manually issue the msbuild command with the following command line, it appears that it builds successfully because it does generate the "Release" directory under the "build" directory. In the "Release" directory, it shows node_sqlite3.node, node_sqlite3.lib

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe build/bindings.sln /verbosity:m /
nologo /p:Configuration=Release;Platform="win32"

Perhaps the first parameter /clp:Verbosity=minimal may need to be read as /verbosity:minimal instead.
Then the /p:Configuration=Release needs to be /p:Configuration=Release;Platform="win32" or Platform="Any CPU". In the bindings.sln file, it seems to specify Win32 in it.

Granted, I am not a msbuild person nor I am a platform build type person. But it seems to work to finish the build.

Hope this helps. Thanks.

Make "Git Bash" or a vanilla cmd window work

Currently Windows only works inside a Visual Studio Command Prompt.

Let's fix that by attempting to guess where msbuild.exe lives by default and executing it directly.

If that seems to cause any problems, then attempt to find the vcvarsall.bat file based on its default location and spawn a process like cmd /s /c "C:\\path\\too\\vcvarsall.bat && msbuild", but hopefully the first option works out.

Add Python version to README

Hello,

This could be a time-saver for those who are new to node-gyp to see from the beginning that it requires Python 2.7 not 3.x version. When windows newbies like me are downloading software they usually take latest version and for Python it’s not a best choice :)

Could you add this to wiki and README please ?

x64

I'm trying node-gyp rebuild from the contextify master and get:
(Note: VC++ 2010 and python 2..x are installed)

C:\Source\contextify>node-gyp build -v
info it worked if it ends with ok
verb command 'build' []
verb build args []
verb build type: 'Release'
verb architecture: 'x64'
verb node version: '0.6.14'
verb found first Solution file 'build/binding.sln'
verb could not find "msbuild.exe". guessing location
verb "Release" dir needed to be created? false
spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe [ 'build/binding
.sln',
'/nologo',
'/p:Configuration=Release;Platform=x64' ]
Build started 16/04/2012 5:20:29 PM.
Project "C:\Source\contextify\build\binding.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Release|x64".
Project "C:\Source\contextify\build\binding.sln" (1) is building "C:\Source\con
textify\build\contextify.vcxproj" (2) on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform
.Targets(23,7): error MSB8007: The Platform for project 'contextify.vcxproj' is
invalid. Platform='x64'. You may be seeing this message because you are tryin
g to build a project without a solution file, and have specified a non-default
Platform that doesn't exist for this project. [C:\Source\contextify\build\conte
xtify.vcxproj]
Done Building Project "C:\Source\contextify\build\contextify.vcxproj" (default
targets) -- FAILED.

Done Building Project "C:\Source\contextify\build\binding.sln" (default targets
) -- FAILED.

'configure' should output a 'config.gypi' file

This would be like how node's ./configure script works. This would be cool cause then we could add hooks for users to add --shared-libmp3lame options and stuff. The target_arch should also go in there, etc.

error: exception handling disabled, use -fexceptions to enable

I'm trying to update zeromq.node to use gyp as part of the process of getting it running on Windows (JustinTulloss/zeromq.node#81). I'm currently blocked by gyp's -fno-exceptions default (I think), but will probably run into linking issues soon enough.

Here's binding.gyp:

{
  'targets': [
    {
      'target_name': 'binding',
      'sources': [ 'binding.cc' ],
      'cflags': ['-fexceptions'],
      'cflags_cc': ['-fexceptions']
    }
  ]
}

Here's a transcript:

seth@lotus:~/src/JustinTulloss/zeromq.node [⚑ gyp] $ node-gyp configure --target=0.7
info it worked if it ends with ok 
spawn python [ '/Users/seth/.node-gyp/0.7/tools/gyp_addon',
  '-f',
  'make',
  '--suffix',
  '.gyp',
  '-I',
  '/Users/seth/.node-gyp/0.7/tools/patch2722.gypi',
  '-Dtarget_arch=x64' ]
info done ok 
seth@lotus:~/src/JustinTulloss/zeromq.node [⚑ gyp] $ node-gyp build
info it worked if it ends with ok 
spawn make [ 'BUILDTYPE=Release', '-f', 'Makefile.gyp' ]
  CXX(target) out/Release/obj.target/binding/binding.o
binding.cc: In constructor β€˜zmq::Context::Context(int)’:
binding.cc:185: error: exception handling disabled, use -fexceptions to enable
make: *** [out/Release/obj.target/binding/binding.o] Error 1
ERR! `make` failed with exit code: 2
ERR! not ok

Windows 64-bit support

I got it working the other night with some manual hacking, but now it's time to get it working smoothly.

I used MSVC 2010 Express edition alongside the Windows 7 SDK: http://www.microsoft.com/download/en/details.aspx?displayLang=en&id=8279

We need to download the 64-bit node.lib file every time on install and store it somewhere like <dev files>/x64/node.lib. This way --arch can be supported as expected. This gets a little complicated at build-time since the addon.gypi file is looking for <dev files>/<Configuration>/node.lib, so during the build step on Windows it's gonna have to copy over the proper node.lib file into the proper location.

The other kinda hard part is guessing the proper location of the 64-bit msbuild.exe file. Probably just hard-code it for now like the 32-bit version.

MSVS 2011 beta doesn't work?

Just to let you know it fails when using visual studio 11 beta.

ERR! Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed w
ith exit code: 1

trying to work out why.

spider uses contextify.

Contextify is supposed to use the new build systems. as per here.
brianmcd/contextify#17

I looked into the path where it is looking for the cdproj, but its not there.

Mhhh ?

Gerard

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\_data\_SvnRepo\Prod\ITProject_UbuntuDesignWebSite\tools\nodejs>node install s
pider

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Cannot find module 'C:\_data\_SvnRepo\Prod\ITProject_UbuntuDesignWebSite\
tools\nodejs\install'
    at Function._resolveFilename (module.js:332:11)
    at Function._load (module.js:279:25)
    at Array.0 (module.js:479:10)
    at EventEmitter._tickCallback (node.js:192:40)

C:\_data\_SvnRepo\Prod\ITProject_UbuntuDesignWebSite\tools\nodejs>npm install sp
ider
npm http GET https://registry.npmjs.org/spider
npm http 304 https://registry.npmjs.org/spider
npm http GET https://registry.npmjs.org/routes
npm http GET https://registry.npmjs.org/cookiejar
npm http GET https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/cookiejar
npm http 304 https://registry.npmjs.org/routes
npm http 304 https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/htmlparser
npm http 304 https://registry.npmjs.org/htmlparser
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings

> [email protected] install C:\_data\_SvnRepo\Prod\ITProject_UbuntuDesignWebSite\
tools\nodejs\node_modules\spider\node_modules\jsdom\node_modules\contextify
> node-gyp rebuild


C:\_data\_SvnRepo\Prod\ITProject_UbuntuDesignWebSite\tools\nodejs\node_modules\s
pider\node_modules\jsdom\node_modules\contextify>node "C:\Program Files (x86)\no
dejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp
.js" rebuild
info it worked if it ends with ok
spawn C:\Python27\python.exe [ 'C:\\Users\\gerard\\.node-gyp\\0.6.14\\tools\\gyp
_addon',
  'binding.gyp',
  '-IC:\\_data\\_SvnRepo\\Prod\\ITProject_UbuntuDesignWebSite\\tools\\nodejs\\no
de_modules\\spider\\node_modules\\jsdom\\node_modules\\contextify\\build\\config
.gypi',
  '-f',
  'msvs',
  '-G',
  'msvs_version=2010' ]
spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe [ 'build/binding
.sln',
  '/clp:Verbosity=minimal',
  '/nologo',
  '/p:Configuration=Release;Platform=Win32' ]
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.t
argets(34,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform
Toolset = 'v100') cannot be found. To build using the v100 build tools, either
click the Project menu or right-click the solution, and then select "Update VC+
+ Projects...". Install Visual Studio 2010 to build using the Visual Studio 201
0 build tools. [C:\_data\_SvnRepo\Prod\ITProject_UbuntuDesignWebSite\tools\node
js\node_modules\spider\node_modules\jsdom\node_modules\contextify\build\context
ify.vcxproj]
ERR! Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed w
ith exit code: 1
    at Array.0 (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node
-gyp\lib\build.js:176:25)
    at EventEmitter._tickCallback (node.js:192:40)
ERR! not ok
npm WARN optional dependency failed, continuing [email protected]
[email protected] ./node_modules/spider
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
└── [email protected]

C:\_data\_SvnRepo\Prod\ITProject_UbuntuDesignWebSite\tools\nodejs>

Relative directory for libraries

It seems like some version since 0.1.3 introduced the (very nice!) feature of keeping temporary files under build/, but it also made it so that we now have to prefix a ../ for libraries.

For example, where my binding.gyp once had:

'conditions': [
        ['OS=="mac"', {
          'include_dirs': [
            'deps/qt-4.8.0/darwin/x64/include',
            'deps/qt-4.8.0/darwin/x64/include/QtCore',
            'deps/qt-4.8.0/darwin/x64/include/QtGui',
            'deps/qt-4.8.0/darwin/x64/include/QtTest'
          ],
          'libraries': [
            'deps/qt-4.8.0/darwin/x64/lib/QtCore.framework/QtCore',
            'deps/qt-4.8.0/darwin/x64/lib/QtGui.framework/QtGui',
            'deps/qt-4.8.0/darwin/x64/lib/QtTest.framework/QtTest'
          ],
        }]

it now needs ../deps in libraries (apparently not in include):

'conditions': [
        ['OS=="mac"', {
          'include_dirs': [
            'deps/qt-4.8.0/darwin/x64/include',
            'deps/qt-4.8.0/darwin/x64/include/QtCore',
            'deps/qt-4.8.0/darwin/x64/include/QtGui',
            'deps/qt-4.8.0/darwin/x64/include/QtTest'
          ],
          'libraries': [
            '../deps/qt-4.8.0/darwin/x64/lib/QtCore.framework/QtCore',
            '../deps/qt-4.8.0/darwin/x64/lib/QtGui.framework/QtGui',
            '../deps/qt-4.8.0/darwin/x64/lib/QtTest.framework/QtTest'
          ],
        }]

The updated source is at http://github.com/arturadib/node-qt

Windows: node-gyp sets wrong include path

My addon is on drive d:\ and my home dir is on drive c:.

This makes node-gyp set the include path as follows:

/I"..\..\..\..\..\C:Users\Bert Belder\.node-gyp\0.7\src" /I"..\..\..\..\..\C:Users\Bert Belder\.node-gyp\0.7\deps\uv\include" /I"..\..\..\..\..\C:Users\Bert Belder\.node-gyp\0.7\deps\v8\include"

Make 0.6.x work

Copy the files from the legacy dir to the 0.6/tools dir when 0.6 is being installed. Boom.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.