New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error C2373: '__pfnDliNotifyHook2': redefinition; #972

Closed
zetsin opened this Issue Jul 1, 2016 · 29 comments

Comments

Projects
None yet
@zetsin

zetsin commented Jul 1, 2016

  • ERR
 win_delay_load_hook.c
C:\Users\zetsin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373:
'__pfnDliNotifyHook2': redefinition; different type modifiers [D:\GitHub\node-winode\node_modules\ref\build\binding.vcx
proj]
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134): note: see declaration of '__pfnDliNot
  ifyHook2'
  • WHILE
npm install ref
  • ENV
Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

>node -v
v4.4.7
>npm -v
3.10.2
>node-gyp -v
v3.4.0
>python -V
Python 2.7.12
>msbuild /ver
14.0.25420.1
@addaleax

This comment has been minimized.

Show comment
Hide comment
@addaleax

addaleax Jul 1, 2016

Member

npm -g install npm@next?

Member

addaleax commented Jul 1, 2016

npm -g install npm@next?

@zetsin

This comment has been minimized.

Show comment
Hide comment
@zetsin

zetsin Jul 1, 2016

Thanks a lot, @addaleax 👍

Something wrong happened:

"...\npm\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.cc':** No such file or directory

after npm -g install npm@next

So I did that:

cd "...\npm\node_modules\npm\
npm install

It works, finally

zetsin commented Jul 1, 2016

Thanks a lot, @addaleax 👍

Something wrong happened:

"...\npm\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.cc':** No such file or directory

after npm -g install npm@next

So I did that:

cd "...\npm\node_modules\npm\
npm install

It works, finally

@zetsin zetsin closed this Jul 1, 2016

@addaleax

This comment has been minimized.

Show comment
Hide comment
@addaleax

addaleax Jul 1, 2016

Member

Something wrong happened:

That does not look like something that should happen. Do you still have the npm-debug.log from that installation attempt?

Member

addaleax commented Jul 1, 2016

Something wrong happened:

That does not look like something that should happen. Do you still have the npm-debug.log from that installation attempt?

@zetsin

This comment has been minimized.

Show comment
Hide comment
@zetsin

zetsin Jul 1, 2016

Let me do it again.

rd/s/q "...\npm\node_modules\npm"
npm -g install npm@next
cd "...\npm\node_modules\npm\node_modules\node-gyp"
dir

I found that there is no "src" folder in "node-gyp", so the wrong happened when i use node-gyp build(e.g. npm install ref)

"...\npm\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.cc':** No such file or directory

zetsin commented Jul 1, 2016

Let me do it again.

rd/s/q "...\npm\node_modules\npm"
npm -g install npm@next
cd "...\npm\node_modules\npm\node_modules\node-gyp"
dir

I found that there is no "src" folder in "node-gyp", so the wrong happened when i use node-gyp build(e.g. npm install ref)

"...\npm\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.cc':** No such file or directory

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Jul 1, 2016

Member

cd "...\npm\node_modules\npm\node_modules\node_gyp"

Is that a typo? The directory is called 'node-gyp', not 'node_gyp'.

Member

bnoordhuis commented Jul 1, 2016

cd "...\npm\node_modules\npm\node_modules\node_gyp"

Is that a typo? The directory is called 'node-gyp', not 'node_gyp'.

@zetsin

This comment has been minimized.

Show comment
Hide comment
@zetsin

zetsin Jul 1, 2016

Yeah, its a typo I have edited, i'm so sorry. @bnoordhuis

zetsin commented Jul 1, 2016

Yeah, its a typo I have edited, i'm so sorry. @bnoordhuis

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Jul 1, 2016

Member

No problem. Just to be sure, can you delete your node_modules directory and install npm@next again?

If you still can't build ref, can you post the full build log of npm install ref?

Member

bnoordhuis commented Jul 1, 2016

No problem. Just to be sure, can you delete your node_modules directory and install npm@next again?

If you still can't build ref, can you post the full build log of npm install ref?

@RanzQ

This comment has been minimized.

Show comment
Hide comment
@RanzQ

RanzQ Jul 1, 2016

I found a workaround, go to AppData\Roaming\npm\node_modules\npm and type npm remove node-gyp then npm install node-gyp.

I think this is due to using npm-windows-upgrade. It guides to use --production flag so I guess it installs npm with --production too. So node-gyp was missing src/.

First I had a problem that the upgrade was installing npm@3.10.3 and it had the previous node-gyp. I posted a comment about it. So I had node-gyp@3.4.0 in my global node_modules but 3.3.1 inside npm.

Anyway, now I'm finally able to build. :)

RanzQ commented Jul 1, 2016

I found a workaround, go to AppData\Roaming\npm\node_modules\npm and type npm remove node-gyp then npm install node-gyp.

I think this is due to using npm-windows-upgrade. It guides to use --production flag so I guess it installs npm with --production too. So node-gyp was missing src/.

First I had a problem that the upgrade was installing npm@3.10.3 and it had the previous node-gyp. I posted a comment about it. So I had node-gyp@3.4.0 in my global node_modules but 3.3.1 inside npm.

Anyway, now I'm finally able to build. :)

@rvagg

This comment has been minimized.

Show comment
Hide comment
@rvagg

rvagg Jul 5, 2016

Member

fwiw npm@next is probably not going to fix this, yet, there was a problem in the upgrade that went out with 3.10.4, see npm/npm#13256 (my fault somehow I believe). It's been fixed in tree and I imagine it'll be out soon in a 3.10.5. npm@2 works fine though if you're able to use v2.

Member

rvagg commented Jul 5, 2016

fwiw npm@next is probably not going to fix this, yet, there was a problem in the upgrade that went out with 3.10.4, see npm/npm#13256 (my fault somehow I believe). It's been fixed in tree and I imagine it'll be out soon in a 3.10.5. npm@2 works fine though if you're able to use v2.

@andrezzoid

This comment has been minimized.

Show comment
Hide comment
@andrezzoid

andrezzoid Jul 6, 2016

@rvagg I think I may have the same issue with npm 2.14.12. I have pretty much the same environment as @zetsingithub, except for the npm version. I was trying to install mariasql and got:

win_delay_load_hook.c
C:\Users\Andre\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\src\w
in_delay_load_hook.c(31): error C2373: '__pfnDliNotifyHook2': redefinition; dif
ferent type modifiers [D:\Projects\betarena_chat\node_modules\mariasql\build\de
ps\libmariadbclient\mysys_ssl\mysys_ssl.vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134
  ): note: see declaration of '__pfnDliNotifyHook2'

Do you know if this issue might affect npm@2 as well?

andrezzoid commented Jul 6, 2016

@rvagg I think I may have the same issue with npm 2.14.12. I have pretty much the same environment as @zetsingithub, except for the npm version. I was trying to install mariasql and got:

win_delay_load_hook.c
C:\Users\Andre\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\src\w
in_delay_load_hook.c(31): error C2373: '__pfnDliNotifyHook2': redefinition; dif
ferent type modifiers [D:\Projects\betarena_chat\node_modules\mariasql\build\de
ps\libmariadbclient\mysys_ssl\mysys_ssl.vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134
  ): note: see declaration of '__pfnDliNotifyHook2'

Do you know if this issue might affect npm@2 as well?

@rvagg

This comment has been minimized.

Show comment
Hide comment
@rvagg

rvagg Jul 7, 2016

Member

yep, you need 2.15.9: https://github.com/npm/npm/releases/tag/v2.15.9
I think npm i npm@2 -g should be enough to upgrade you, we don't carry it in our Node LTS releases yet but it'll get there.

Member

rvagg commented Jul 7, 2016

yep, you need 2.15.9: https://github.com/npm/npm/releases/tag/v2.15.9
I think npm i npm@2 -g should be enough to upgrade you, we don't carry it in our Node LTS releases yet but it'll get there.

@Vasanthrajan

This comment has been minimized.

Show comment
Hide comment
@Vasanthrajan

Vasanthrajan Jul 9, 2016

@rvagg That did the trick, Thank you!

Vasanthrajan commented Jul 9, 2016

@rvagg That did the trick, Thank you!

@SwadicalRag

This comment has been minimized.

Show comment
Hide comment
@SwadicalRag

SwadicalRag Jul 11, 2016

Had the same issue, npm -g install npm@next fixed it for me, if anyone else is in the same boat.

SwadicalRag commented Jul 11, 2016

Had the same issue, npm -g install npm@next fixed it for me, if anyone else is in the same boat.

@DTHompson55

This comment has been minimized.

Show comment
Hide comment
@DTHompson55

DTHompson55 Jul 11, 2016

npm -g install npm@next appears to be the magic sauce. Thanks for posting that!

DTHompson55 commented Jul 11, 2016

npm -g install npm@next appears to be the magic sauce. Thanks for posting that!

@httpdigest

This comment has been minimized.

Show comment
Hide comment
@httpdigest

httpdigest Jul 11, 2016

Same here. I tried to install the oracledb module and got the same redefinition; different type modifiers for __pfnDliNotifyHook2 error.
Doing a npm -g install npm@next did fix this issue.

httpdigest commented Jul 11, 2016

Same here. I tried to install the oracledb module and got the same redefinition; different type modifiers for __pfnDliNotifyHook2 error.
Doing a npm -g install npm@next did fix this issue.

@rvagg

This comment has been minimized.

Show comment
Hide comment
@rvagg

rvagg Jul 12, 2016

Member

npm -g install npm@latest should do the trick now that it's been pushed out in a stable release, no need to jump forward to next which can sometimes contain regressions.

Member

rvagg commented Jul 12, 2016

npm -g install npm@latest should do the trick now that it's been pushed out in a stable release, no need to jump forward to next which can sometimes contain regressions.

@chrismark

This comment has been minimized.

Show comment
Hide comment
@chrismark

chrismark Nov 2, 2016

npm -g install npm@next worked. Thanks.

chrismark commented Nov 2, 2016

npm -g install npm@next worked. Thanks.

@ocombe

This comment has been minimized.

Show comment
Hide comment
@ocombe

ocombe Nov 3, 2016

For me npm i -g npm@next didn't work, but the trick from @RanzQ to reinstall node-gyp worked ! Thanks a lot this was driving me crazy

ocombe commented Nov 3, 2016

For me npm i -g npm@next didn't work, but the trick from @RanzQ to reinstall node-gyp worked ! Thanks a lot this was driving me crazy

@XadillaX

This comment has been minimized.

Show comment
Hide comment
@XadillaX

XadillaX Jan 18, 2017

Member

What shall I do if I don't want to use next? Because I hate flatten dependencies.

Member

XadillaX commented Jan 18, 2017

What shall I do if I don't want to use next? Because I hate flatten dependencies.

@addaleax

This comment has been minimized.

Show comment
Hide comment
@addaleax

addaleax Jan 18, 2017

Member

@XadillaX It’s been a while since you had to use npm@next to resolve this; just upgrade your npm or node to the latest version and you should be fine.

Member

addaleax commented Jan 18, 2017

@XadillaX It’s been a while since you had to use npm@next to resolve this; just upgrade your npm or node to the latest version and you should be fine.

tvrprasad added a commit to tvrprasad/tedious that referenced this issue Feb 1, 2017

Fix installation failures for versions 0.10.48, 0.12.18 and 5.12.0.
npm install for these versions is failing due to a bug that causes
installation of native modules to fail with the error:
C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34):
error C2373: '__pfnDliNotifyHook2': redefinition; different type modifiers
[C:\projects\tedious\node_modules\sspi-client\build\sspi-client.vcxproj]

This seems to be a known issue with certain npm/node-gyp versions:
nodejs/node-gyp#972
nodejs/node#7286

Fixing this by installing the latest version of npm before running the
tests.

juliangruber added a commit to datproject/rabin that referenced this issue Feb 9, 2017

tptee added a commit to tptee/node-webworker-threads that referenced this issue Apr 16, 2017

@jradesenv

This comment has been minimized.

Show comment
Hide comment
@jradesenv

jradesenv Apr 25, 2017

just to note that npm install -g npm@next broke my npm x.x
so i uninstalled node and installed again, tried it all again and the npm got broken again. Any command i try to execute, even only "npm" just causes a lot of errors like "cannot find npmlog module".

Need to say that i'm using nvm to install and use node 5.3.0 as my old project needs. And the first issue i had was installing node-oracledb. This project worked months ago, and it still works in my macosx but in windows i'm with these errors.

Will try to install node 5.3.0 and use just npm install -g npm as @jasonswearingen suggested

jradesenv commented Apr 25, 2017

just to note that npm install -g npm@next broke my npm x.x
so i uninstalled node and installed again, tried it all again and the npm got broken again. Any command i try to execute, even only "npm" just causes a lot of errors like "cannot find npmlog module".

Need to say that i'm using nvm to install and use node 5.3.0 as my old project needs. And the first issue i had was installing node-oracledb. This project worked months ago, and it still works in my macosx but in windows i'm with these errors.

Will try to install node 5.3.0 and use just npm install -g npm as @jasonswearingen suggested

@springmeyer

This comment has been minimized.

Show comment
Hide comment
@springmeyer

springmeyer May 30, 2017

Contributor

note: most of the workarounds here recommend upgrading node-gyp by upgrading npm, which is fine. But in some cases users may instead wish to upgrade just node-gyp, which also fixes this issue (since the underlying bug was fixed in #952).

Contributor

springmeyer commented May 30, 2017

note: most of the workarounds here recommend upgrading node-gyp by upgrading npm, which is fine. But in some cases users may instead wish to upgrade just node-gyp, which also fixes this issue (since the underlying bug was fixed in #952).

@jacobq

This comment has been minimized.

Show comment
Hide comment
@jacobq

jacobq Jun 21, 2017

@springmeyer I am using node-gyp v3.6.2 and still having this problem (node v6.11.0 and npm v3.10.10). Does that release contain the fix you mentioned?

jacobq commented Jun 21, 2017

@springmeyer I am using node-gyp v3.6.2 and still having this problem (node v6.11.0 and npm v3.10.10). Does that release contain the fix you mentioned?

@springmeyer

This comment has been minimized.

Show comment
Hide comment
@springmeyer

springmeyer Jun 21, 2017

Contributor

Yes @jacobq - as far as I can tell the fix landed in v3.3.3: #956. Perhaps you have an older version being invoked without realizing it?

Contributor

springmeyer commented Jun 21, 2017

Yes @jacobq - as far as I can tell the fix landed in v3.3.3: #956. Perhaps you have an older version being invoked without realizing it?

@jacobq

This comment has been minimized.

Show comment
Hide comment
@jacobq

jacobq Jun 22, 2017

(Edited)
@springmeyer Whoa, I think you're right, but I have no idea why this is happening. Any ideas how it might get stuck at an old version? For example, is it possible for another module to list it in package.json or something?

The error is happening in node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c on the line

PfnDliHook __pfnDliNotifyHook2 = load_exe_hook;

which was fixed/changed in node-gyp in f31482e in June 2016, and I think it was part of the fix you mentioned. Trying to see where this file was coming from I went up a few levels to node_modules\npm\node_modules\node-gyp\package.json and found this:

{
  "_args": [
    [
      "node-gyp@~3.2.1",
      "/Users/ogd/Documents/projects/npm/npm"
    ]
  ],
  "_from": "node-gyp@>=3.2.1 <3.3.0",
  "_id": "node-gyp@3.2.1",
  "_inCache": true,
  "_installable": true,
  "_location": "/npm/node-gyp",
  "_nodeVersion": "6.0.0-pre",
  "_npmUser": {
    "email": "info@bnoordhuis.nl",
    "name": "bnoordhuis"
  },
  "_npmVersion": "3.3.12",
...

It looks like that was installed because npm (why is that in node_modules??) required: "node-gyp": "~3.2.1".

Update: Ah, I think I finally found it! The culprit was ember-cli-release because of https://github.com/lytics/ember-cli-release/blob/3ea88c52e575c52b901e08b0dd900926b759d0b0/package.json#L30

jacobq commented Jun 22, 2017

(Edited)
@springmeyer Whoa, I think you're right, but I have no idea why this is happening. Any ideas how it might get stuck at an old version? For example, is it possible for another module to list it in package.json or something?

The error is happening in node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c on the line

PfnDliHook __pfnDliNotifyHook2 = load_exe_hook;

which was fixed/changed in node-gyp in f31482e in June 2016, and I think it was part of the fix you mentioned. Trying to see where this file was coming from I went up a few levels to node_modules\npm\node_modules\node-gyp\package.json and found this:

{
  "_args": [
    [
      "node-gyp@~3.2.1",
      "/Users/ogd/Documents/projects/npm/npm"
    ]
  ],
  "_from": "node-gyp@>=3.2.1 <3.3.0",
  "_id": "node-gyp@3.2.1",
  "_inCache": true,
  "_installable": true,
  "_location": "/npm/node-gyp",
  "_nodeVersion": "6.0.0-pre",
  "_npmUser": {
    "email": "info@bnoordhuis.nl",
    "name": "bnoordhuis"
  },
  "_npmVersion": "3.3.12",
...

It looks like that was installed because npm (why is that in node_modules??) required: "node-gyp": "~3.2.1".

Update: Ah, I think I finally found it! The culprit was ember-cli-release because of https://github.com/lytics/ember-cli-release/blob/3ea88c52e575c52b901e08b0dd900926b759d0b0/package.json#L30

springmeyer added a commit to mapbox/node-sqlite3 that referenced this issue Aug 4, 2017

vunb added a commit to vunb/node-fasttext that referenced this issue Mar 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment