Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

node-sass compilation fails on Windows - node_version.h not found #3062

Closed
Beenhakker opened this issue Jan 22, 2021 · 3 comments
Closed

node-sass compilation fails on Windows - node_version.h not found #3062

Beenhakker opened this issue Jan 22, 2021 · 3 comments

Comments

@Beenhakker
Copy link

  • NPM version (npm -v): 6.14.5
  • Node version (node -v): 14.4.0
  • Node Process (node -p process.versions): 14.4.0
  • Node Platform (node -p process.platform): win32
  • Node architecture (node -p process.arch): x64
  • node-sass version (node -p "require('node-sass').info"): ^5.0 (trying to install, latest)
  • npm node-sass versions (npm ls node-sass): ^5.0 (trying to install, latest)

So, I installed Windows build tools, and set npm config (nodedir (node_headers) and msvs_version=2019).
node_version.h is available in "nodedir", however I get this error:

"c:\development\luci\luci\node_modules\node-sass\build\binding.sln" (default target) (1) ->
"c:\development\luci\luci\node_modules\node-sass\build\binding.vcxproj.metaproj" (default target) (2) ->
"c:\development\luci\luci\node_modules\node-sass\build\binding.vcxproj" (default target) (4) ->
(ClCompile target) ->
  c:\development\luci\luci\node_modules\nan\nan.h(24,10): fatal error C1083: Cannot open include file: 'node_version.h': No such file or directory [c:\development\luci\luci\node_modules\node-sass\build\binding
.vcxproj]
    48 Warning(s)
    1 Error(s)

@nschonni
Copy link
Contributor

It should be able to pull down the pre-built binaries? If you're trying to do something "offline", it's probably the same as #2097

@saper
Copy link
Member

saper commented Mar 25, 2021

Can you show how did you exactly did that: "set npm config (nodedir (node_headers) and msvs_version=2019)." ? How does your npm configuration look like now?

@Beenhakker
Copy link
Author

Hi,

Sorry, cannot recall what I eventually did. I had to fix our TFS pipeline, and use NPM instead of git clone, what we used before.

You know the thrill, in the middle of the heat a lot of things were going wrong, and I needed to sort out a lot of things.

I believe in the end I installed the NPM headers via vs_buildtools, which solved it, and I forgot to close the issue.

Indeed we cannot get the pre-built binaries, since we are behind a firewall.

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

No branches or pull requests

3 participants