Skip to content
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

gyp ignores MSBuild in path variable and chooses older version from .NET Framework #2202

Closed
voltmer1 opened this issue Aug 27, 2020 · 2 comments
Labels
Node Sass --> Dart Sass https://github.com/sass/node-sass/issues/2952 Windows

Comments

@voltmer1
Copy link

voltmer1 commented Aug 27, 2020

  • Node Version: 14.8.0 and 6.14.7
  • Platform: Microsoft Windows 10 Pro, 10.0.18362 Build18362, x64-based PC
  • Compiler: MSBuild v 15.0.0
  • Module: node-sass
I have set the system environment variable "PATH" with the path to MSBuild, but as gyp runs it finds this version on PATH, then later overrides it for a much older version within .NET Framework.
npm install node-sass -g
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\Steve\\Documents\\GitHub\\MyRH-SPO\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@14.8.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "C:\Users\Steve\.windows-build-tools\python27\python.exe" in the PATH
gyp verb `which` succeeded C:\Users\Steve\.windows-build-tools\python27\python.exe C:\Users\Steve\.windows-build-tools\python27\python.exe  
gyp verb check python version `C:\Users\Steve\.windows-build-tools\python27\python.exe -c "import sys; print "2.7.15
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 14.8.0
gyp verb command install [ '14.8.0' ]
gyp verb install input version string "14.8.0"
gyp verb install installing version: 14.8.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 14.8.0
gyp verb build dir attempting to create "build" dir: C:\Users\Steve\Documents\GitHub\MyRH-SPO\node_modules\node-sass\build
gyp verb build dir "build" dir needed to be created? C:\Users\Steve\Documents\GitHub\MyRH-SPO\node_modules\node-sass\build
gyp verb find vs2017 Found installation at: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
gyp verb find vs2017   - Found Microsoft.VisualStudio.Component.Windows10SDK.17763
gyp verb find vs2017   - Found Microsoft.VisualStudio.Component.VC.Tools.x86.x64
gyp verb find vs2017   - Found Microsoft.VisualStudio.VC.MSBuild.Base
gyp verb find vs2017   - Using this installation with Windows 10 SDK
gyp verb find vs2017 using installation: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: C:\Users\Steve\Documents\GitHub\MyRH-SPO\node_modules\node-sass\build\config.gypi       
gyp verb config.gypi checking for gypi file: C:\Users\Steve\Documents\GitHub\MyRH-SPO\node_modules\node-sass\config.gypi
gyp verb common.gypi checking for gypi file: C:\Users\Steve\Documents\GitHub\MyRH-SPO\node_modules\node-sass\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\Users\Steve\.windows-build-tools\python27\python.exe
gyp info spawn args [
gyp info spawn args   'C:\\Users\\Steve\\Documents\\GitHub\\MyRH-SPO\\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\\Steve\\Documents\\GitHub\\MyRH-SPO\\node_modules\\node-sass\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Steve\\Documents\\GitHub\\MyRH-SPO\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Steve\\.node-gyp\\14.8.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=C:\\Users\\Steve\\.node-gyp\\14.8.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\Steve\\Documents\\GitHub\\MyRH-SPO\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\Steve\\.node-gyp\\14.8.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\Steve\\Documents\\GitHub\\MyRH-SPO\\node_modules\\node-sass',
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\\Steve\\Documents\\GitHub\\MyRH-SPO\\node_modules\\node-sass\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\Steve\.node-gyp\14.8.0
gyp verb found first Solution file build/binding.sln
gyp verb `which` succeeded for `msbuild` C:\Windows\Microsoft.NET\Framework\v2.0.50727\msbuild.EXE
gyp info spawn msbuild
gyp info spawn args [
gyp info spawn args   'build/binding.sln',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
build/binding.sln(1): Solution file error MSB5014: File format version is not recognized.  MSBuild can only read solution files between versions 7.0 and 9.0, inclusive.
gyp ERR! build error 
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Steve\Documents\GitHub\MyRH-SPO\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Steve\\Documents\\GitHub\\MyRH-SPO\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\Steve\Documents\GitHub\MyRH-SPO\node_modules\node-sass
gyp ERR! node -v v14.8.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN @pnp/sp-clientsvc@1.3.11 requires a peer of @pnp/common@1.3.11 but none is installed. You must install peer dependencies yourself.
npm WARN @pnp/sp-clientsvc@1.3.11 requires a peer of @pnp/logging@1.3.11 but none is installed. You must install peer dependencies yourself.npm WARN @pnp/sp-clientsvc@1.3.11 requires a peer of @pnp/odata@1.3.11 but none is installed. You must install peer dependencies yourself.
npm WARN @pnp/sp-clientsvc@1.3.11 requires a peer of @pnp/sp@1.3.11 but none is installed. You must install peer dependencies yourself.     
npm WARN @pnp/sp-taxonomy@1.3.11 requires a peer of @pnp/logging@1.3.11 but none is installed. You must install peer dependencies yourself.
npm WARN @pnp/sp-taxonomy@1.3.11 requires a peer of @pnp/common@1.3.11 but none is installed. You must install peer dependencies yourself.
npm WARN @pnp/sp-taxonomy@1.3.11 requires a peer of @pnp/odata@1.3.11 but none is installed. You must install peer dependencies yourself.
npm WARN @pnp/sp-taxonomy@1.3.11 requires a peer of @pnp/sp@1.3.11 but none is installed. You must install peer dependencies yourself.      
npm WARN ajv-keywords@3.4.1 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"
npm ERR! errno 1
npm ERR! node-sass@4.9.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.9.3 postinstall script.

This should look like this:

>npm --verbose
npm info it worked if it ends with ok
npm verb cli [
npm verb cli   'C:\\...\\node\\13.9.0\\x64\\node.exe',
npm verb cli   'C:\\...\\node\\13.9.0\\x64\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   '--verbose'
npm verb cli ]
npm info using npm@6.13.7
npm info using node@v13.9.0

Usage: npm <command>
npm install node-sass
@cclauss cclauss added the Node Sass --> Dart Sass https://github.com/sass/node-sass/issues/2952 label Aug 27, 2020
@cclauss
Copy link
Contributor

cclauss commented Aug 27, 2020

sass/node-sass#2952

@voltmer1
Copy link
Author

That being said, this is not a node-sass issue. I get the same error when using any package that requires node-gyp. It refuses to use the MSBuild version over what is in the .NET Framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Node Sass --> Dart Sass https://github.com/sass/node-sass/issues/2952 Windows
Projects
None yet
Development

No branches or pull requests

2 participants