Skip to content

Cannot open include file: 'setimmediate.h' #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
q00u opened this issue Sep 23, 2019 · 15 comments
Closed

Cannot open include file: 'setimmediate.h' #21

q00u opened this issue Sep 23, 2019 · 15 comments

Comments

@q00u
Copy link

q00u commented Sep 23, 2019

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?

@addaleax
Copy link
Contributor

Can you share more debug output, e.g. npm-debug.log?

@q00u
Copy link
Author

q00u commented Sep 23, 2019

Console error:

$ npm install

> [email protected] 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: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: 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 [email protected]
688 silly decomposeActions extract [email protected]
689 silly decomposeActions preinstall [email protected]
690 silly decomposeActions build [email protected]
691 silly decomposeActions install [email protected]
692 silly decomposeActions postinstall [email protected]
693 silly decomposeActions finalize [email protected]
694 silly decomposeActions refresh-package-json [email protected]
695 silly decomposeActions fetch [email protected]
696 silly decomposeActions extract [email protected]
697 silly decomposeActions preinstall [email protected]
698 silly decomposeActions build [email protected]
699 silly decomposeActions install [email protected]
700 silly decomposeActions postinstall [email protected]
701 silly decomposeActions finalize [email protected]
702 silly decomposeActions refresh-package-json [email protected]
703 silly decomposeActions fetch [email protected]
704 silly decomposeActions extract [email protected]
705 silly decomposeActions preinstall [email protected]
706 silly decomposeActions build [email protected]
707 silly decomposeActions install [email protected]
708 silly decomposeActions postinstall [email protected]
709 silly decomposeActions finalize [email protected]
710 silly decomposeActions refresh-package-json [email protected]
711 silly decomposeActions fetch [email protected]
712 silly decomposeActions extract [email protected]
713 silly decomposeActions preinstall [email protected]
714 silly decomposeActions build [email protected]
715 silly decomposeActions install [email protected]
716 silly decomposeActions postinstall [email protected]
717 silly decomposeActions finalize [email protected]
718 silly decomposeActions refresh-package-json [email protected]
(snip)
802 silly extract [email protected]
803 silly extract [email protected]
804 silly extract [email protected]
805 silly extract [email protected]
(snip)
834 silly tarball trying [email protected] by hash: sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==
835 silly tarball trying [email protected] by hash: sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=
836 silly tarball trying [email protected] by hash: sha512-DkfCLZzpeRa4XvMSD2XwbtYCUmdKCxsHpm6doIeFResBDp4QFvOuN7ZBJWAQKEc+Dg6nuH5NeNij5JzDK1BQSg==
837 silly tarball trying [email protected] by hash: sha512-cyqeMaYA5qI7RoZKAKvIHwEROEKDNxK7jXj3u56nF2rGBh+HFyhYmBb1/wAN4RqzRmkYKVVKQyqHpBoJjqtGUA==
(snip)
845 silly extract [email protected] extracted to C:\Users\(my user folder)\(my project folder)\node_modules\.staging\setimmediate-0081d775 (540ms)
(snip)
866 silly extract [email protected] extracted to C:\Users\(my user folder)\(my project folder)\node_modules\.staging\setimmediate-napi-094c00de (772ms)
(snip)
870 silly extract [email protected] 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 [email protected]~preinstall: [email protected]
1127 silly preinstall [email protected]
1128 info lifecycle [email protected]~preinstall: [email protected]
1129 silly preinstall [email protected]
1130 info lifecycle [email protected]~preinstall: [email protected]
1131 silly preinstall [email protected]
1132 info lifecycle [email protected]~preinstall: [email protected]
1133 silly preinstall [email protected]
(snip)
1210 silly build [email protected]
1211 info linkStuff [email protected]
1212 silly linkStuff [email protected] 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 [email protected]
1215 info linkStuff [email protected]
1216 silly linkStuff [email protected] has C:\Users\(my user folder)\(my project folder)\node_modules as its parent node_modules
1217 silly build [email protected]
1218 info linkStuff [email protected]
1219 silly linkStuff [email protected] has C:\Users\(my user folder)\(my project folder)\node_modules as its parent node_modules
1220 silly build [email protected]
1221 info linkStuff [email protected]
1222 silly linkStuff [email protected] has C:\Users\(my user folder)\(my project folder)\node_modules as its parent node_modules
(snip)
1291 silly install [email protected]
1292 info lifecycle [email protected]~install: [email protected]
1293 silly install [email protected]
1294 info lifecycle [email protected]~install: [email protected]
1295 silly install [email protected]
1296 info lifecycle [email protected]~install: [email protected]
1297 silly install [email protected]
1298 info lifecycle [email protected]~install: [email protected]
1299 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle true
1300 verbose lifecycle [email protected]~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 [email protected]~install: CWD: C:\Users\(my user folder)\(my project folder)\node_modules\weak-napi
1302 silly lifecycle [email protected]~install: Args: [ '/d /s /c', 'node-gyp rebuild' ]
1303 silly lifecycle [email protected]~install: Returned: code: 1  signal: null
1304 info lifecycle [email protected]~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: [email protected] (node_modules\fsevents):
1315 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: 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 ]

@addaleax
Copy link
Contributor

Hm, maybe this is a Windows-specific issue? I’ll try to look into this tomorrow, thanks for the report.

@sam17896
Copy link

I am also getting same issue on windows

@1Jesper1
Copy link

1Jesper1 commented Nov 15, 2019

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

@kaiyoma
Copy link

kaiyoma commented Jan 23, 2020

Also getting this failure on Windows 10 after upgrading some packages. Specifically, after upgrading esprint to the latest version.

@kaiyoma
Copy link

kaiyoma commented Jan 24, 2020

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.

@addaleax
Copy link
Contributor

@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 :/

@kaiyoma
Copy link

kaiyoma commented Jan 24, 2020

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 " > [email protected]" 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 [email protected]
gyp info using [email protected] | 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"

@addaleax
Copy link
Contributor

@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.

@q00u
Copy link
Author

q00u commented Jan 24, 2020

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.

@addaleax
Copy link
Contributor

@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.

addaleax added a commit to node-ffi-napi/get-symbol-from-current-process-h that referenced this issue Jan 24, 2020
addaleax added a commit to node-ffi-napi/get-uv-event-loop-napi-h that referenced this issue Jan 24, 2020
addaleax added a commit to node-ffi-napi/setimmediate-napi that referenced this issue Jan 24, 2020
@addaleax
Copy link
Contributor

@q00u @kaiyoma I've published updated versions of the relevant packages. Can you check whether your issue has been resolved?

@kaiyoma
Copy link

kaiyoma commented Jan 24, 2020

I tried a fresh install with the package.json above and everything worked correctly. 🎉

@addaleax
Copy link
Contributor

Great! I’ll close this out, if anybody has similar trouble, feel free to open a new issue. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants