node-gyp compile error c2240 cannot convert from &

2019-03-01 14:05发布

问题:

The 2440 error point into the ".node-gyp\4.4.5\include\node\v8.h(221)", so I have no idea what's goes wrong.

p.s. compiled on a windows machine.

Is there any way to figure out which sentence is causing this error, it's my first time to use node-gyp, thanks.

回答1:

Same issue here. Most probably because we use newer nodejs v4.4.5 version and it can no longer work with C++ Build Tools in Visual Studio 2012/2013. (someone else can clarify this?)

You can try C++ Build Tools in Visual Studio 2015 but run this before you compile:

npm -g install npm@next

Refer to here https://github.com/nodejs/node-gyp/issues/972 to fix win_delay_load_hook.c(34): error C2373: '__pfnDliNotifyHook2' if you run with 2015.