node-gyp: Node-gyp error when trying to build any module

  • Node Version: node -v v10.15.3andnpm -v` 6.4.1
  • Platform: System Windows_NT 10.0.17763
  • Module: it complains when i do yarn install or I add pretty much any module
Verbose output (from npm or node-gyp):
ricard@workstation1 MINGW64 ~/Desktop/nameOfMyProject
$ yarn install
yarn install v1.16.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/traveling-fastlane-darwin@1.5.0: The platform "win32" is incompatible with this module.
info "@expo/traveling-fastlane-darwin@1.5.0" is an optional dependency and failed co
mpatibility check. Excluding it from installation.
info @expo/ngrok-bin-darwin-ia32@2.2.8: The platform "win32" is incompatible with this module.
info "@expo/ngrok-bin-darwin-ia32@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-darwin-ia32@2.2.8: The CPU architecture "x64" is incompatible with this module.
info @expo/ngrok-bin-darwin-x64@2.2.8: The platform "win32" is incompatible with this module.
info "@expo/ngrok-bin-darwin-x64@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-freebsd-ia32@2.2.8: The platform "win32" is incompatible with this module.
info "@expo/ngrok-bin-freebsd-ia32@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-freebsd-ia32@2.2.8: The CPU architecture "x64" is incompatiblewith this module.
info @expo/ngrok-bin-freebsd-x64@2.2.8: The platform "win32" is incompatible with this module.
info "@expo/ngrok-bin-freebsd-x64@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-linux-arm@2.2.8: The platform "win32" is incompatible with this module.
info "@expo/ngrok-bin-linux-arm@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-linux-arm@2.2.8: The CPU architecture "x64" is incompatible with this module.
info @expo/ngrok-bin-linux-arm64@2.2.8: The platform "win32" is incompatible with this module.
info "@expo/ngrok-bin-linux-arm64@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-linux-arm64@2.2.8: The CPU architecture "x64" is incompatible with this module.
info @expo/ngrok-bin-linux-ia32@2.2.8: The platform "win32" is incompatible with this module.
info "@expo/ngrok-bin-linux-ia32@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-linux-ia32@2.2.8: The CPU architecture "x64" is incompatible with this module.
info @expo/ngrok-bin-linux-x64@2.2.8: The platform "win32" is incompatible with this module.
info "@expo/ngrok-bin-linux-x64@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-sunos-x64@2.2.8: The platform "win32" is incompatible with this module.
info "@expo/ngrok-bin-sunos-x64@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-win32-ia32@2.2.8-beta.1: The CPU architecture "x64" is incompatible with this module.
info "@expo/ngrok-bin-win32-ia32@2.2.8-beta.1" is an optional dependency and failedcompatibility check. Excluding it from installation.
info @expo/traveling-fastlane-darwin@1.6.2: The platform "win32" is incompatible with this module.
info "@expo/traveling-fastlane-darwin@1.6.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info @google-cloud/functions-emulator@1.0.0-beta.5: The engine "node" is incompatible with this module. Expected version "~6". Got "10.15.3"
info "@google-cloud/functions-emulator@1.0.0-beta.5" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "expo > react-native-reanimated@1.0.0-alpha.10" has incorrect peer dependency "react@16.0.0-alpha.6".
warning "expo > react-native-reanimated@1.0.0-alpha.10" has incorrect peer dependency "react-native@^0.44.1".
warning "firebase > @firebase/database@0.2.1" has unmet peer dependency "@firebase/app-types@^0.1.0".
warning "firebase > @firebase/firestore@0.3.7" has unmet peer dependency "@firebase/app-types@^0.1.0".
warning "firebase > @firebase/functions@0.1.0" has unmet peer dependency "@firebase/app-types@^0.1.0".
warning "firebase > @firebase/storage@0.1.8" has unmet peer dependency "@firebase/app-types@^0.1.0".
warning "firebase > @firebase/auth > @firebase/auth-types@0.2.0" has unmet peer dependency "@firebase/app-types@^0.1.0".
warning "firebase > @firebase/database > @firebase/database-types@0.2.0" has unmet peer dependency "@firebase/app-types@^0.1.0".
warning "firebase > @firebase/firestore > @firebase/firestore-types@0.2.2" has unmet peer dependency "@firebase/app-types@^0.1.0".
warning "firebase > @firebase/functions > @firebase/messaging-types@0.1.3" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/messaging > @firebase/messaging-types@0.1.2" has unmet peer dependency "@firebase/app-types@^0.1.0".
warning "firebase > @firebase/storage > @firebase/storage-types@0.1.2" has unmet peer dependency "@firebase/app-types@^0.1.0".
warning " > react-avatar@3.4.6" has unmet peer dependency "prop-types@^15.0.0 || ^16.0.0".
warning " > react-i18next@8.4.0" has unmet peer dependency "prop-types@15.6.2".warning "react-i18next > create-react-context@0.2.3" has unmet peer dependency "prop-types@^15.0.0".
warning " > react-native-svg-charts@5.2.0" has incorrect peer dependency "react-native-svg@^6.2.1".
warning "react-navigation > create-react-context@0.2.2" has unmet peer dependency "prop-types@^15.0.0".
warning "jest-expo > react-test-renderer@16.6.3" has incorrect peer dependency "react@^16.6.3".
[4/4] Building fresh packages...
[-/8] ⢀ waiting...
[-/8] ⢀ waiting...
[6/8] ⠠ iltorb
[7/8] ⠠ node-zopfli
warning Error running install script for optional dependency: "C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\shrink-ray\\node_modules\\iltorb: Command f
ailed.
Exit code: 7
Command: detect-libc prebuild-install || node-gyp rebuild
Arguments:
Directory: C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\shrink-ray\
\node_modules\\iltorb
Output:
prebuild-install WARN install No prebuilt binaries found (target=10.15.3 runtime=node arch=x64 platform=win32)
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | win32 | x64
gyp info spawn C:\\Python27\\python.exe
gyp info spawn args [ 'C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-gyp\\\\gyp\\\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\shrink-ray\\\\node_modules\\\\iltorb\\\\build\\\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-gyp\\\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\\\Users\\\\ricard\\\\.node-gyp\\\\10.15.3\\\\include\\\\node\\\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\\\Users\\\\ricard\\\\.node-gyp\\\\10.15.3',
gyp info spawn args   '-Dnode_gyp_dir=C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\ricard\\\\.node-gyp\\\\10.15.3\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\shrink-ray\\\\node_modules\\\\iltorb',
gyp info spawn args   '-Dnode_engine=v8',gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\shrink-ray\\\\node_modules\\\\iltorb\\\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\MSBuild\\15.0\\Bin\\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\MSBuild\\15.0\\Bin\\MSBuild.exe ENOENT
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js
:240:19)
gyp ERR! stack     at onErrorNT (internal/child_process.js:415:16)
gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" \"C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-gyp\\\\bin\\\\node-gyp.j
s\" \"rebuild\"
gyp ERR! cwd C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\shrink-ra
y\\node_modules\\iltorb
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
[-/8] ⢀ waiting...
[-/8] ⢀ waiting...
[-/8] ⠠ waiting...
[7/8] ⠠ node-zopfli
error C:\Users\ricard\Desktop\nameOfMyProject\node_modules\iltorb: Command failed
.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: C:\Users\ricard\Desktop\nameOfMyProject\node_modules\iltorb
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.39
node-pre-gyp info using node@10.15.3 | win32 | x64
node-pre-gyp info check checked for "C:\Users\ricard\Desktop\nameOfMyProject\node_modules\iltorb\build\bindings\encode.node" (not found)
node-pre-gyp http GET https://node-iltorb.s3.amazonaws.com/iltorb/v1.3.4/node-v64-win32-x64.tar.gz
node-pre-gyp http 404 https://node-iltorb.s3.amazonaws.com/iltorb/v1.3.4/node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://node-iltorb.s3.amazonaws.com/iltorb/v1.3.4/node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for iltorb@1.3.4 and node@10.15.3 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://node-iltorb.s3.amazonaws.com/iltorb/v1.3.4/node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Tried to download(undefined): https://node-iltorb.s3.amazonaws.com
/iltorb/v1.3.4/node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for iltorb@1.3.4 and node@10.15.3 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http Connection closed while downloading tarball file 
gypgyp info it worked if it ends with ok
info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | win32 | x64
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | win32 | x64
gyp info ok
gyp info ok
gyp info it worked if it ends with ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | win32 | x64
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | win32 | x64
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\iltorb\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\ricard\\.node-gyp\\10.15.3\\include\\node\\common.
gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\ricard\\.node-gyp\\10.15.3',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\ricard\\Desktop\\nameOfMyProject
\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\ricard\\.node-gyp\\10.15.3\\<(targ
et_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\ricard\\Desktop\\givme5mobilebac
kup\\node_modules\\iltorb',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\
\iltorb\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\
\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\
\iltorb\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\
\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\ricard\\.node-gyp\\10.15.3\\include\\node\\common.
gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\ricard\\.node-gyp\\10.15.3',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\ricard\\.node-gyp\\10.15.3\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\iltorb',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\
\iltorb\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | win32 | x64
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | win32 | x64
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
gyp ERR! stack     at onErrorNT (internal/child_process.js:415:16)
gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to
-build" "--module=C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\iltorb\\build\\bindings\\encode.node" "--module_name=encode" "--module_path=C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\iltorb\\build\\bindings"
gyp ERR! cwd C:\Users\ricard\Desktop\nameOfMyProject\node_modules\iltorb
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\ricard\Desktop\nameOfMyProject\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\ricard\Desktop\nameOfMyProject\node_modules\iltorb\build\bindings\encode.node --module_name=encode --module_path=C:\Users\ric
ard\Desktop\nameOfMyProject\node_modules\iltorb\build\bindings' (7)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\ricard\Desktop\nameOfMyProject\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:970:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Windows_NT 10.0.17763
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install
" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\ricard\Desktop\nameOfMyProject\node_modules\iltorbnode-pre-gyp ERR! node -v v10.15.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\ricard\Desktop\nameOfMyProject\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\ricard\Desktop\nameOfMyProject\node_modules\iltorb\build\bindings\encode




warning Error running install script for optional dependency: "C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-zopfli: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-zopfliOutput:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.39
node-pre-gyp info using node@10.15.3 | win32 | x64
node-pre-gyp info check checked for \"C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-zopfli\\lib\\binding\\node-v64-win32-x64\\zopfli.node\" (not fo
und)
node-pre-gyp http GET https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v64-win32-x64.tar.gz
node-pre-gyp http 403 https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Tried to download(403): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@1.4.0 and node@10.15.3 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 403 status code downloading tarball https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Tried to download(undefined): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@1.4.0 and node@10.15.3 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http Connection closed while downloading tarball file
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | win32 | x64
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | win32 | x64
gyp info ok
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | win32 | x64
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | win32 | x64
gyp info spawn C:\\Python27\\python.exe
gyp info spawn args [ 'C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-gyp\\\\gyp\\\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-zopfli\\\\build\\\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-gyp\\\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\\\Users\\\\ricard\\\\.node-gyp\\\\10.15.3\\\\include\\\\node\\\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\\\Users\\\\ricard\\\\.node-gyp\\\\10.15.3',
gyp info spawn args   '-Dnode_gyp_dir=C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\ricard\\\\.node-gyp\\\\10.15.3\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-zopfli',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-zopfli\\\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\\Python27\\python.exe
gyp info spawn args [ 'C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-gyp\\\\gyp\\\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-zopfli\\\\build\\\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-gyp\\\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\\\Users\\\\ricard\\\\.node-gyp\\\\10.15.3\\\\include\\\\node\\\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\\\Users\\\\ricard\\\\.node-gyp\\\\10.15.3',
gyp info spawn args   '-Dnode_gyp_dir=C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\ricard\\\\.node-gyp\\\\10.15.3\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-zopfli',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-zopfli\\\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok
Traceback (most recent call last):
  File \"C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\gyp\\gyp_main.py\", line 16, in <module>
    sys.exit(gyp.script_main())
  File \"C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\__init__.py\", line 545, in script_main
    return main(sys.argv[1:])
  File \"C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\__init__.py\", line 538, in main
    return gyp_main(args)
  File \"C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\__init__.py\", line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File \"C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\generator\\msvs.py\", line 2025, in GenerateOutput
    version=msvs_version)
  File \"C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\MSVSNew.py\", line 213, in __init__
    self.Write()
  File \"C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\MSVSNew.py\", line 340, in Write
    f.close()
  File \"C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\common.py\", line 393, in close
    os.rename(self.tmp_path, filename)
WindowsError: [Error 183] Cannot create a file when that file already exists
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\\Users\\ricard\\Desktop\\givme5mobil
ebackup\\node_modules\\node-gyp\\lib\\configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js
:248:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" \"C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-gyp\\\\bin\\\\node-gyp.j
s\" \"configure\" \"--fallback-to-build\" \"--module=C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-zopfli\\\\lib\\\\binding\\\\node-v64
-win32-x64\\\\zopfli.node\" \"--module_name=zopfli\" \"--module_path=C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-zopfli\\\\lib\\\\bin
ding\\\\node-v64-win32-x64\" \"--python=python2.7\" \"--msvs_version=2017\"gyp ERR! cwd C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-zopfli
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\\Program Files\\nodejs\\node.exe C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\bin\\node-gyp.js configure --fallback-to-build --module=C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-zopfli\\lib\\binding\\node-v64-win32-x64\\zopfli.node --module_name=zopfli --module_path=C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-zopfli\\lib\\binding\\node-v64-win32-x64 --python=python2.7 --msvs_
version=2017' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-pre-gyp\\lib\\util\\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:970:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Windows_NT 10.0.17763
node-pre-gyp ERR! command \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" \"C:\\\\Users\\\\ricard\\\\Desktop\\\\nameOfMyProject\\\\node_modules\\\\node-pre-gyp\\\\bin\
\\\node-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-zopfli
node-pre-gyp ERR! node -v v10.15.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'C:\\Program Files\\nodejs\\node.exe C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-gyp\\bin\\node-gyp.js configure --fallback-to-build --module=C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-zopfli\\lib\\binding\\node-v64-win32-x64\\zopfli.node --module_name=zopfli --module_path=C:\\Users\\ricard\\Desktop\\nameOfMyProject\\node_modules\\node-zopfli\\lib\\binding\\node-v64-win32-x64 --python=python2.7 --msvs_version=2017' (1)"
info This module is OPTIONAL, you can safely ignore this error

Mainly I am having this issue since one of the modules I am using in my react native project somehow requires it. I’ve tried to downgrade my npm version to a version I saw it works on some people but I actually have no idea how to solve this issue or how to solve it. My project goes from working perfectly to not working because of this so any help would be more than appreaciated. I tried many workarounds but honestly I don’t know at this point how should address this issue.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

windows isn’t my forte but there’s a lot of concurrent access / permission errors there, are you sure nothing else is working on those files? maybe reboot to be absolutely clear that there’s no lingering build process?

also, yarn could be the problem here, I believe we’ve had some yarn+windows problems reported in the past (again, not my forte, I haven’t been keeping track), just an npm install might be worth a try.

@joaocgreis Thanks a ton for all the explanation! I figured I had some other setting in my build that demanded an older version of node-gyp and changing that seemed to fix this issue.

@Dirken seems like the command node-gyp rebuild --silly for you is picking up the node-gyp@5.0.3 version but according to your yarn command, error was with node-gyp@3.8.0

Can you check if you have some hard coded dependency to use this version in your package.json files or your build steps. You can alternatively try uninstalling the node-gyp package, clean your local npm cache (Also check your AppData/Roaming/ folders for older versions of node-gyp) and then reinstall the latest version.