abbr / NodeSSPI

Server-side windows authentication for Node.js
MIT License
156 stars 19 forks source link

Build fails: fatal error C1083: Cannot open include file: 'atlenc.h #89

Open a3rtgm-ds opened 3 years ago

a3rtgm-ds commented 3 years ago

I cannot install v0.2.8 with Node v14.15.1 (also tried v12.20 and v15). Also tried updating node-gyp and the build tools. System: Win 10 x64

No binary is available, so it tries to build... Fails with:

Warning: Missing input files:
C:\CSL\dev\mp-admintool\node_modules\node-sspi\build\..\src\*.cpp
C:\CSL\dev\mp-admintool\node_modules\node-sspi\build\..\src\*.h
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  NodeSSPI.cpp
  win_delay_load_hook.cc
c:\csl\dev\mp-admintool\node_modules\node-sspi\src\nodesspi.h(10): fatal error C1083: Cannot open include file: 'atlenc.h': No such file or directory (compiling source file ..\src\NodeSSPI.cpp) [C:\CSL\dev\mp-admintool\node_modules\node-sspi\build\NodeSSPI.vcxpr
oj]
?[37;40mgyp?[0m ?[0m?[31;40mERR!?[0m ?[0m?[35mbuild error?[0m
?[0m?[37;40mgyp?[0m ?[0m?[31;40mERR!?[0m ?[0m?[35mstack?[0m Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
?[0m?[37;40mgyp?[0m ?[0m?[31;40mERR!?[0m ?[0m?[35mstack?[0m     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
?[0m?[37;40mgyp?[0m ?[0m?[31;40mERR!?[0m ?[0m?[35mstack?[0m     at ChildProcess.emit (events.js:314:20)
?[0m?[37;40mgyp?[0m ?[0m?[31;40mERR!?[0m ?[0m?[35mstack?[0m     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
?[0m?[37;40mgyp?[0m ?[0m?[31;40mERR!?[0m ?[0m?[35mSystem?[0m Windows_NT 10.0.17763
?[0m?[37;40mgyp?[0m ?[0m?[31;40mERR!?[0m ?[0m?[35mcommand?[0m "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
?[0m?[37;40mgyp?[0m ?[0m?[31;40mERR!?[0m ?[0m?[35mcwd?[0m C:\CSL\dev\mp-admintool\node_modules\node-sspi
?[0m?[37;40mgyp?[0m ?[0m?[31;40mERR!?[0m ?[0m?[35mnode -v?[0m v14.5.0
?[0m?[37;40mgyp?[0m ?[0m?[31;40mERR!?[0m ?[0m?[35mnode-gyp -v?[0m v5.1.0
?[0m?[37;40mgyp?[0m ?[0m?[31;40mERR!?[0m ?[0m?[35mnot ok?[0m
?[0mBuild failed

Also tried assigning a different node-gyp version through npm config set node_gyp

Appreciate your help :)

xcapt commented 3 years ago

As with the above person: npm i was complaining about atlenc.h on build

Cause: ATL libraries was not installed by default with installation of Visual studio build tools (npm i -g windows-build-tools)

Solution: 1) Went to Windows settings / apps & features on Visual Studio Installer and on Build tools clicked on modify to install the ATL libraries 2) launched npm i again => build successful, node-sspi 0.2.8 installed

allens01 commented 3 years ago

@xcapt I had the same issue and your fix worked for me, thanks!

UXPURE commented 2 years ago

@xcapt Same here. Thank you