Closed q00u closed 4 years ago
Can you share more debug output, e.g. npm-debug.log?
Console error:
$ npm install
> weak-napi@1.0.3 install C:\Users\(my user folder)\(my project folder)\node_modules\weak-napi
> node-gyp rebuild
C:\Users\(my user folder)\(my project folder)\node_modules\weak-napi>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
nothing.c
win_delay_load_hook.cc
nothing.vcxproj -> C:\Users\(my user folder)\(my project folder)\node_modules\weak-napi\build\Release\\nothing.lib
weakref.cc
win_delay_load_hook.cc
c:\users\(my user folder)\(my project folder)\node_modules\weak-napi\src\weakref.cc(2): fatal error C1083: Cannot open include file: 'setimmediate.h': No such file or directory [C:\Users\(my user folder)\(my project folder)\node_modules\weak-napi\build\weakref.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.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:196:23)
gyp ERR! stack at ChildProcess.emit (events.js:209:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.17763
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:\Users\(my user folder)\(my project folder)\node_modules\weak-napi
gyp ERR! node -v v12.10.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\(my user folder)\AppData\Roaming\npm-cache\_logs\2019-09-23T22_04_45_233Z-debug.log
The debug log file is pretty big, and I'm not sure which parts are relevant:
687 silly decomposeActions fetch node-gyp@3.8.0
688 silly decomposeActions extract node-gyp@3.8.0
689 silly decomposeActions preinstall node-gyp@3.8.0
690 silly decomposeActions build node-gyp@3.8.0
691 silly decomposeActions install node-gyp@3.8.0
692 silly decomposeActions postinstall node-gyp@3.8.0
693 silly decomposeActions finalize node-gyp@3.8.0
694 silly decomposeActions refresh-package-json node-gyp@3.8.0
695 silly decomposeActions fetch setimmediate@1.0.5
696 silly decomposeActions extract setimmediate@1.0.5
697 silly decomposeActions preinstall setimmediate@1.0.5
698 silly decomposeActions build setimmediate@1.0.5
699 silly decomposeActions install setimmediate@1.0.5
700 silly decomposeActions postinstall setimmediate@1.0.5
701 silly decomposeActions finalize setimmediate@1.0.5
702 silly decomposeActions refresh-package-json setimmediate@1.0.5
703 silly decomposeActions fetch setimmediate-napi@1.0.5
704 silly decomposeActions extract setimmediate-napi@1.0.5
705 silly decomposeActions preinstall setimmediate-napi@1.0.5
706 silly decomposeActions build setimmediate-napi@1.0.5
707 silly decomposeActions install setimmediate-napi@1.0.5
708 silly decomposeActions postinstall setimmediate-napi@1.0.5
709 silly decomposeActions finalize setimmediate-napi@1.0.5
710 silly decomposeActions refresh-package-json setimmediate-napi@1.0.5
711 silly decomposeActions fetch weak-napi@1.0.3
712 silly decomposeActions extract weak-napi@1.0.3
713 silly decomposeActions preinstall weak-napi@1.0.3
714 silly decomposeActions build weak-napi@1.0.3
715 silly decomposeActions install weak-napi@1.0.3
716 silly decomposeActions postinstall weak-napi@1.0.3
717 silly decomposeActions finalize weak-napi@1.0.3
718 silly decomposeActions refresh-package-json weak-napi@1.0.3
(snip)
802 silly extract node-gyp@3.8.0
803 silly extract setimmediate@1.0.5
804 silly extract setimmediate-napi@1.0.5
805 silly extract weak-napi@1.0.3
(snip)
834 silly tarball trying node-gyp@3.8.0 by hash: sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==
835 silly tarball trying setimmediate@1.0.5 by hash: sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=
836 silly tarball trying setimmediate-napi@1.0.5 by hash: sha512-DkfCLZzpeRa4XvMSD2XwbtYCUmdKCxsHpm6doIeFResBDp4QFvOuN7ZBJWAQKEc+Dg6nuH5NeNij5JzDK1BQSg==
837 silly tarball trying weak-napi@1.0.3 by hash: sha512-cyqeMaYA5qI7RoZKAKvIHwEROEKDNxK7jXj3u56nF2rGBh+HFyhYmBb1/wAN4RqzRmkYKVVKQyqHpBoJjqtGUA==
(snip)
845 silly extract setimmediate@1.0.5 extracted to C:\Users\(my user folder)\(my project folder)\node_modules\.staging\setimmediate-0081d775 (540ms)
(snip)
866 silly extract setimmediate-napi@1.0.5 extracted to C:\Users\(my user folder)\(my project folder)\node_modules\.staging\setimmediate-napi-094c00de (772ms)
(snip)
870 silly extract weak-napi@1.0.3 extracted to C:\Users\(my user folder)\(my project folder)\node_modules\.staging\weak-napi-79c25140 (852ms)
(snip)
972 silly finalize C:\Users\(my user folder)\(my project folder)\node_modules\node-gyp
973 silly finalize C:\Users\(my user folder)\(my project folder)\node_modules\setimmediate
974 silly finalize C:\Users\(my user folder)\(my project folder)\node_modules\setimmediate-napi
975 silly finalize C:\Users\(my user folder)\(my project folder)\node_modules\weak-napi
(snip)
1042 silly refresh-package-json C:\Users\(my user folder)\(my project folder)\node_modules\weak-napi
1043 silly refresh-package-json C:\Users\(my user folder)\(my project folder)\node_modules\setimmediate-napi
1044 silly refresh-package-json C:\Users\(my user folder)\(my project folder)\node_modules\setimmediate
1045 silly refresh-package-json C:\Users\(my user folder)\(my project folder)\node_modules\node-gyp
1046 silly refresh-package-json C:\Users\(my user folder)\(my project folder)\node_modules\node-gyp\node_modules\semver
1047 silly refresh-package-json C:\Users\(my user folder)\(my project folder)\node_modules\node-addon-api
(snip)
1126 info lifecycle node-gyp@3.8.0~preinstall: node-gyp@3.8.0
1127 silly preinstall setimmediate@1.0.5
1128 info lifecycle setimmediate@1.0.5~preinstall: setimmediate@1.0.5
1129 silly preinstall setimmediate-napi@1.0.5
1130 info lifecycle setimmediate-napi@1.0.5~preinstall: setimmediate-napi@1.0.5
1131 silly preinstall weak-napi@1.0.3
1132 info lifecycle weak-napi@1.0.3~preinstall: weak-napi@1.0.3
1133 silly preinstall jest-leak-detector@25.0.0
(snip)
1210 silly build node-gyp@3.8.0
1211 info linkStuff node-gyp@3.8.0
1212 silly linkStuff node-gyp@3.8.0 has C:\Users\(my user folder)\(my project folder)\node_modules as its parent node_modules
1213 verbose linkBins [
1213 verbose linkBins { 'node-gyp': './bin/node-gyp.js' },
1213 verbose linkBins 'C:\\Users\\(my user folder)\\(my project folder)\\node_modules\\.bin',
1213 verbose linkBins false
1213 verbose linkBins ]
1214 silly build setimmediate@1.0.5
1215 info linkStuff setimmediate@1.0.5
1216 silly linkStuff setimmediate@1.0.5 has C:\Users\(my user folder)\(my project folder)\node_modules as its parent node_modules
1217 silly build setimmediate-napi@1.0.5
1218 info linkStuff setimmediate-napi@1.0.5
1219 silly linkStuff setimmediate-napi@1.0.5 has C:\Users\(my user folder)\(my project folder)\node_modules as its parent node_modules
1220 silly build weak-napi@1.0.3
1221 info linkStuff weak-napi@1.0.3
1222 silly linkStuff weak-napi@1.0.3 has C:\Users\(my user folder)\(my project folder)\node_modules as its parent node_modules
(snip)
1291 silly install node-gyp@3.8.0
1292 info lifecycle node-gyp@3.8.0~install: node-gyp@3.8.0
1293 silly install setimmediate@1.0.5
1294 info lifecycle setimmediate@1.0.5~install: setimmediate@1.0.5
1295 silly install setimmediate-napi@1.0.5
1296 info lifecycle setimmediate-napi@1.0.5~install: setimmediate-napi@1.0.5
1297 silly install weak-napi@1.0.3
1298 info lifecycle weak-napi@1.0.3~install: weak-napi@1.0.3
1299 verbose lifecycle weak-napi@1.0.3~install: unsafe-perm in lifecycle true
1300 verbose lifecycle weak-napi@1.0.3~install: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\(my user folder)\(my project folder)\node_modules\weak-napi\node_modules\.bin;C:\Users\(my user folder)\(my project folder)\node_modules\.bin;C:\Users\(my user folder)\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\(my user folder)\bin;C:\Python27;C:\Python27\Scripts;C:\Program Files\AdoptOpenJDK\jdk-11.0.4.11-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\ProgramData\WebEx\WebEx\Applications;C:\Program Files (x86)\Sennheiser\SoftphoneSDK;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\130\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\(my user folder)\scoop\shims;C:\Users\(my user folder)\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\cmd;C:\Users\(my user folder)\AppData\Local\Programs\Fiddler;C:\Program Files (x86)\apache-maven-3.6.1\bin;C:\Users\(my user folder)\.dotnet\tools;C:\Users\(my user folder)\AppData\Local\Microsoft\WindowsApps;C:\Users\(my user folder)\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
1301 verbose lifecycle weak-napi@1.0.3~install: CWD: C:\Users\(my user folder)\(my project folder)\node_modules\weak-napi
1302 silly lifecycle weak-napi@1.0.3~install: Args: [ '/d /s /c', 'node-gyp rebuild' ]
1303 silly lifecycle weak-napi@1.0.3~install: Returned: code: 1 signal: null
1304 info lifecycle weak-napi@1.0.3~install: Failed to exec install script
1305 timing action:install Completed in 18003ms
1306 verbose unlock done using C:\Users\(my user folder)\AppData\Roaming\npm-cache\_locks\staging-829d060d81a7ade0.lock for C:\Users\(my user folder)\(my project folder)\node_modules\.staging
1307 timing stage:rollbackFailedOptional Completed in 1366ms
1308 timing stage:runTopLevelLifecycles Completed in 44034ms
(snip to end)
1314 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
1315 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
1316 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
1316 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
1316 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
1316 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
1317 verbose stack RangeError: Maximum call stack size exceeded
1317 verbose stack at RegExp.test (<anonymous>)
1317 verbose stack at isDepOptional (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:416:27)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:432:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1317 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:448:9)
1318 verbose cwd C:\Users\(my user folder)\(my project folder)
1319 verbose Windows_NT 10.0.17763
1320 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
1321 verbose node v12.10.0
1322 verbose npm v6.10.3
1323 error Maximum call stack size exceeded
1324 verbose exit [ 1, true ]
Hm, maybe this is a Windows-specific issue? I’ll try to look into this tomorrow, thanks for the report.
I am also getting same issue on windows
Any fix available @addaleax ? We have the same problem. Seems we were already on Jest 25.0.0 branch, reverted to 24.8.0 to fix this problem! https://github.com/facebook/jest/blob/8a10175d4fc57ace6b5eb9758230975c905d75bc/CHANGELOG.md
Also getting this failure on Windows 10 after upgrading some packages. Specifically, after upgrading esprint to the latest version.
I went back and tried all the old versions of this package and only 1.0.0 builds correctly for me. All the other versions have this Cannot open include file: 'setimmediate.h': No such file or directory
error.
@kaiyoma Unfortunately, I can't reproduce this through npm install weak-napi
or npm install ffi-napi
, so you may have to share more information here in order for me to reproduce this :/
This package.json is enough to do it for me:
{
"name": "weak-napi-test",
"devDependencies": {
"esprint": "0.6.0"
}
}
Here's the output of yarn install
:
yarn install v1.21.1
warning package.json: No license field
info No lockfile found.
warning weak-napi-test: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > esprint@0.6.0" has unmet peer dependency "eslint@>=3".
[4/4] Building fresh packages...
warning Error running install script for optional dependency: "<redacted>\\node_modules\\weak-napi: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: <redacted>\\node_modules\\weak-napi
Output:
<redacted>\\node_modules\\weak-napi>if not defined npm_config_node_gyp (node \"C:\\Program Files\\Node.js\\node_modules\\npm\\bin\\node-gyp-bin\\\\..\\..\\node_modules
\\node-gyp\\bin\\node-gyp.js\" rebuild ) else (node \"\" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.5
gyp info using node@10.16.0 | win32 | x64
gyp info find Python using Python version 2.7.16 found at \"C:\\Python\\python.exe\"
gyp info find VS using VS2015 (14.0) found at:
gyp info find VS \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\\Python\\python.exe
gyp info spawn args [ 'C:\\\\Program Files\\\\Node.js\\\\node_modules\\\\npm\\\\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 '-I',
gyp info spawn args '<redacted>\\\\node_modules\\\\weak-napi\\\\build\\\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\\\Program Files\\\\Node.js\\\\node_modules\\\\npm\\\\node_modules\\\\node-gyp\\\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '<redacted>\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\10.16.0\\\\include\\\\node\\\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=<redacted>\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\10.16.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\\\Program Files\\\\Node.js\\\\node_modules\\\\npm\\\\node_modules\\\\node-gyp',
gyp info spawn args '-Dnode_lib_file=<redacted>\\\\\\\\AppData\\\\\\\\Local\\\\\\\\node-gyp\\\\\\\\Cache\\\\\\\\10.16.0\\\\\\\\<(target_arch)\\\\\\\\node.lib',
gyp info spawn args '-Dmodule_root_dir=<redacted>\\\\node_modules\\\\weak-napi',
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 '<redacted>\\\\node_modules\\\\weak-napi\\\\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn C:\\Program Files (x86)\\MSBuild\\14.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' ]
Building the projects in this solution one at a time. To enable parallel build, please add the \"/m\" switch.
nothing.c
win_delay_load_hook.cc
nothing.vcxproj -> <redacted>\\node_modules\\weak-napi\\build\\Release\\\\nothing.lib
weakref.cc
win_delay_load_hook.cc
..\\src\\weakref.cc(2): fatal error C1083: Cannot open include file: 'setimmediate.h': No such file or directory [<redacted>\\node_modules\\weak-napi\\build\\weakref.v
cxproj]
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\\Node.js\\node_modules\\npm\\node_modules\\node-gyp\\lib\\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command \"C:\\\\Program Files\\\\Node.js\\\\node.exe\" \"C:\\\\Program Files\\\\Node.js\\\\node_modules\\\\npm\\\\node_modules\\\\node-gyp\\\\bin\\\\node-gyp.js\" \"rebuild\"
gyp ERR! cwd <redacted>\\node_modules\\weak-napi
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok"
@q00u @kaiyoma I could reproduce this after some trying -- unfortunately, both of you most likely removed information that is relevant for debugging this, namely that the path you're installing into contains spaces. 😕
I'll try to fix this, but building native code in paths with spaces tends to go wrong more often than not, and I'd avoid it if at all possible.
Neither my user folder nor the project folder have any spaces in them.
nodjs is installed to Program Files though, and that does have a space.
@q00u With spaces is the only way I could reproduce. It should be fine for Node.js itself to be installed in a path with spaces.
Either way, the spaces issue is the one I will fix because it’s the only one with enough information to address it at the moment.
@q00u @kaiyoma I've published updated versions of the relevant packages. Can you check whether your issue has been resolved?
I tried a fresh install with the package.json above and everything worked correctly. 🎉
Great! I’ll close this out, if anybody has similar trouble, feel free to open a new issue. :)
fatal error C1083: Cannot open include file: 'setimmediate.h': No such file or directory
(during
npm install
after a fresh re-install/upgrade of npm 12.10.0, on an existing project that previously worked fine)I'm so confused. setimmediate-napi IS listed as a dependency, so why can't it find it?