gyp ERR! build error
See original GitHub issueAre two days that I try to install the canvas to use with gitbook, I tried in every way, I’ve read many tutorials on the web, already removed and reinstalled node.js, python 2.7, GTK2 Microsoft Visual Studio Community.
But solves nothing and still keep getting the following message when trying to install the canvas, I tried to install node-gyp alone and has followed several tutorials, but solves nothing.
Here is what I get from the canvas when trying to install it if you can guide me step by step, I will be happy to follow, and I think it can be useful for many, as I see it is a very common problem.
Thank you so much.
c:\Program Files>npm install canvas
\
> canvas@1.4.0 install c:\Program Files\node_modules\canvas
> node-gyp rebuild
c:\Program Files\node_modules\canvas>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Canvas.cc
CanvasGradient.cc
CanvasPattern.cc
CanvasRenderingContext2d.cc
..\src\Canvas.cc(144): warning C4457: declaration of 'data' hides function parameter [c:\Program File
s\node_modules\canvas\build\canvas.vcxproj]
..\src\Canvas.cc(140): note: see declaration of 'data'
color.cc
Image.cc
ImageData.cc
init.cc
win_delay_load_hook.c
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(31): warning
C4055: 'type cast': from data pointer 'HMODULE' to function pointer 'FARPROC' [c:\Program Files\node
_modules\canvas\build\canvas.vcxproj]
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C
2373: '__pfnDliNotifyHook2': redefinition; different type modifiers [c:\Program Files\node_modules\ca
nvas\build\canvas.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134): note: see declarati
on of '__pfnDliNotifyHook2'
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Program Files\node_modules\canvas
gyp ERR! node -v v4.4.7
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "canvas"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! canvas@1.4.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.4.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the canvas 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 information on how to open an issue for this project with:
npm ERR! npm bugs canvas
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls canvas
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! c:\Program Files\npm-debug.log
c:\Program Files>
Issue Analytics
- State:
- Created 7 years ago
- Reactions:9
- Comments:13 (3 by maintainers)
Top Results From Across the Web
GYP ERR! build error. stack Error: 'make' failed with exit code 2
It worked after deleting package-lock.json and re run npm install. If you are using yarn to build your program delete yarn.lock and re...
Read more >gyp ERR! stack Error: make failed with exit code: 2 #1694
Follow these steps to resolve the issue. 1: Make sure you have build-tools installed. ... 3: Delete package-lock.json and node modules folder and ......
Read more >Debugging "Make Failed with Exit Code 2" Error - CodeForGeek
The “Make Failed with Exit Code 2” error occurs during the node modules installation. We see lots of stack trace including the one...
Read more >npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
The error "npm ERR! gyp ERR! stack Error: make failed with exit code: 2" occurs when there's a glitch in your package-lock.json ...
Read more >npm build error "node-gyp rebuild" error (#2768) - GitLab
gyp : Call to 'node -p "require('node-addon-api').include"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp gyp ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
On Ubuntu 14.04 I tried successfully:
To get around the
__pfnDliNotifyHook2error you need to build withnode-gyp@3.4.0. This error:Means you’re running
node-gyp buildornode-gyp rebuildin the wrong directory. binding.gyp is provided by the add-on and is normally in its top-level directory. Good luck!