Skip to content

Instantly share code, notes, and snippets.

@anhnt
Last active July 18, 2016 16:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anhnt/a84ddac2358f8b30e8c7d5defb95c0bb to your computer and use it in GitHub Desktop.
Save anhnt/a84ddac2358f8b30e8c7d5defb95c0bb to your computer and use it in GitHub Desktop.
STEP 1
Perform full installation of C++ Build Tools 2015 (from: https://blogs.msdn.microsoft.com/vcblog/2016/03/31/announcing-the-official-release-of-the-visual-c-build-tools-2015/)
(I say full install because this is what I did, however I don't claim that the full install is necessary)
Note: this may take a while as the full program is over 4GB
STEP 2
Install Python 2.7.11 (from: https://www.python.org/)
Note: during installation select the "add to PATH" option (which is not selected by default)
STEP 3
Run:
npm config set msvs_version 2015 --global
Note: I ran it as administrator in Windows cmd.exe
STEP 4
In my NodeJS project folder (a little blog app i am writing to learn NodeJS), I then ran the install command:
npm install bcrypt --save
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373: '__pfnDliNotifyHook2': redefinition; different type modifiers [C:\Project
s\shipperApp\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134): note: see declaration of '__pfnDliNotifyHook2'
This error stays in relation with npm, node-gyp and Visual Studio 2015 and is already fixed in node-gyp@3.4.0, but npm is still pointing to an old version. As I workaround I can propose this:
Go to your folder where npm is installed, e.g.: C:\Program Files\nodejs\node_modules\npm
Open: package.json
Remove entry for node-gyp in bundleDependencies
Bump version number to 3.4.0 for node-gyp in dependencies
Make a npm i in this directory to install node-gyp@3.4.0 to fix the problem
Relating GitHub issues can be found here:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment