Trying to install gulp-responsive however when npm is getting the sharp package the following error occurs. Tried to install via npm install sharp, same error persists.
System:
Windows: 10 (x64)
node: 6.1.0
npm: 3.8.9
gulp CLI: 1.2.1
gulp: 4.0.0-alpha.2
C:\xampp\htdocs\sandbox - gulp 4\tools>npm install gulp-responsive --save-dev
> [email protected] install C:\xampp\htdocs\sandbox - gulp 4\tools\node_modules\sharp
> node-gyp rebuild
C:\xampp\htdocs\sandbox - gulp 4\tools\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Users\nealv\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Users\nealv\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:401:14)
gyp ERR! stack at C:\Users\nealv\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:356:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:117:15)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\nealv\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xampp\htdocs\sandbox - gulp 4\tools\node_modules\sharp
gyp ERR! node -v v6.1.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm WARN [email protected] No repository field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\nealv\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "gulp-responsive" "--save-dev"
npm ERR! node v6.1.0
npm ERR! npm v3.8.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sharp 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 sharp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sharp
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\sandbox - gulp 4\tools\npm-debug.log
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
http://sharp.dimens.io/en/stable/install/#prerequisites
https://github.com/nodejs/node-gyp#installation
Didn't notice it had these dependencies. So after installing the node-gyp and its dependencies and retrying I get the following:
C:\xampp\htdocs\sandbox - gulp 4\tools>npm install gulp-responsive --save-dev
> [email protected] install C:\xampp\htdocs\sandbox - gulp 4\tools\node_modules\sharp
> node-gyp rebuild
C:\xampp\htdocs\sandbox - gulp 4\tools\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Users\nealv\AppData\Roaming\npm\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.
VError.cpp
VInterpolate.cpp
VImage.cpp
win_delay_load_hook.c
C:\Users\nealv\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373: '
__pfnDliNotifyHook2': redefinition; different type modifiers [C:\xampp\htdocs\sandbox - gulp 4\tools\node_modules\sharp
\build\libvips-cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134): note: see declaration of '__pfnDliNot
ifyHook2'
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:\Users\nealv\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\nealv\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xampp\htdocs\sandbox - gulp 4\tools\node_modules\sharp
gyp ERR! node -v v6.1.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm WARN [email protected] No repository field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\nealv\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "gulp-responsive" "--save-dev"
npm ERR! node v6.1.0
npm ERR! npm v3.8.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sharp 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 sharp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sharp
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\sandbox - gulp 4\tools\npm-debug.log
Please see https://github.com/nodejs/node-gyp/issues/972#issuecomment-231939559
This fixed it, thank you!
Hello,
I've found that my problem on Windows 10 (x64) was problematic path to Python2.7. After I installed python on C:\Python27, everything went smoothly :-) (no spaces, dots and other special chars in path). Probably node-gyp has problems with such cases.
Most helpful comment
This fixed it, thank you!