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

MSBuild difficulties #1067

Closed
vintprox opened this issue Dec 8, 2016 · 14 comments
Closed

MSBuild difficulties #1067

vintprox opened this issue Dec 8, 2016 · 14 comments

Comments

@vintprox
Copy link

vintprox commented Dec 8, 2016

Update

Started from finding lightweight build tools and stuck with MSB8036 error... Now I'm going to install Visual Studio 2017 RC.
Depending on efforts started from #1056 for possible update for VS 2017.

#629 takes a lot of conversation about requirements on Windows. There were mentioned VC++ Build Tools Technical Preview with download link.
It was done to acquire only essential dependencies, that are enough to build node native addons. In comparison it might have size of ~800 MB instead of full build tools package with size of ~8 GB. But now download is missing, Microsoft redirects to smarterror page without helpful response.
Google-searching doesn't give needed result - essentially, Visual C++ Build Tools Technical Preview.

What happened to Technical Preview version and where to find lightweight build tools now?

@joshgav
Copy link

joshgav commented Dec 8, 2016

@vintprox
Copy link
Author

vintprox commented Dec 9, 2016

Still installing - 12 hours. Installing: Visual C++ MSBuild Base Resource Package, loading: Universal CRT Headers Libraries and Sources. I have 2G connection.

@joshgav
Copy link

joshgav commented Dec 9, 2016

Thanks for the feedback @VINTproYKT, that sounds like a frustrating experience. I shared your feedback with the VS team at Microsoft, difficulty in getting and installing VS has been a major focus in the VS 2017 work. Effort has begun in #1056 to ensure 2017 is fully supported by Node.

/cc @bowdenk7 @mousetraps @AndrewPardoe

@vintprox
Copy link
Author

@joshgav Thank you, it has been finally installed on my computer. It may sound like "FTW, that guy still uses 2G" 😁
OK, now I'm all set, going to test it out.

@vintprox
Copy link
Author

vintprox commented Dec 11, 2016

Something bad is going on. I get error when using node-gyp rebuild:

  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\▒▒▒▒▒▒\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build\nslog.vcxproj]

Operation system: Windows 8.1.
Succesfully installed Visual C++ Build Tools.
Having environment variables set:

Key Value
GYP_MSVS_VERSION 2015
VCTargetsPath C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140

That command is already applied: npm config set msvs_version 2015. Reloaded terminal.

Verbose log (starting from node-gyp rebuild):

> nslog@3.0.0 install C:\Users\Родион\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog
> node-gyp rebuild


C:\Users\▒▒▒▒▒▒\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog>if not defined npm_config_node_gyp (node "C:\Users\▒▒▒▒▒▒\AppData\Roaming\npm\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 verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\Родион\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild' ]
gyp info using node-gyp@3.3.1
gyp info using node@7.0.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:/Python27" in the PATH
gyp verb `which` failed Error: not found: C:/Python27
gyp verb `which` failed     at F (C:\Users\Родион\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:63:19)
gyp verb `which` failed     at E (C:\Users\Родион\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:72:29)
gyp verb `which` failed     at C:\Users\Родион\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:81:16
gyp verb `which` failed     at C:\Users\Родион\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\Users\Родион\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:111:15)
gyp verb `which` failed  C:/Python27 Error: not found: C:/Python27
gyp verb `which` failed     at F (C:\Users\Родион\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:63:19)
gyp verb `which` failed     at E (C:\Users\Родион\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:72:29)
gyp verb `which` failed     at C:\Users\Родион\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:81:16
gyp verb `which` failed     at C:\Users\Родион\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\Users\Родион\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:111:15)
gyp verb could not find "C:/Python27". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp verb check python version `C:\Python27\python.exe -c "import platform; print(platform.python_version());"` returned: "2.7.6\r\n"
gyp verb get node dir no --target version specified, falling back to host node version: 7.0.0
gyp verb command install [ '7.0.0' ]
gyp verb install input version string "7.0.0"
gyp verb install installing version: 7.0.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: 7.0.0
gyp verb build dir attempting to create "build" dir: C:\Users\Родион\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build
gyp verb build dir "build" dir needed to be created? C:\Users\Родион\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: C:\Users\Родион\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build\config.gypi
gyp verb config.gypi checking for gypi file: C:\Users\Родион\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\config.gypi
gyp verb common.gypi checking for gypi file: C:\Users\Родион\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\\Users\\Родион\\AppData\\Roaming\\npm\\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   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Родион\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\node_modules\\nslog\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Родион\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Родион\\.node-gyp\\7.0.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\\Родион\\.node-gyp\\7.0.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\Родион\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\Родион\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\node_modules\\nslog',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\Родион\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\node_modules\\nslog\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\Родион\.node-gyp\7.0.0
gyp verb found first Solution file build/binding.sln
gyp verb could not find "msbuild.exe" in PATH - finding location in registry
gyp verb "Release" dir needed to be created? null
gyp verb copying "node.lib" for x64 C:\Users\Родион\.node-gyp\7.0.0\Release\node.lib
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
▒▒▒ઠ ▒஥▒⮢ ▒ ▒⮬ ▒襭▒▒ ▒▒ ▒▒▒▒▒▒. ▒⮡▒ ▒▒▒▒▒▒▒ ▒▒ࠫ▒▒▒▒▒▒ ᡮ▒▒, ▒▒▒▒▒▒▒ ▒▒ࠬ▒▒▒ "/m".
▒▒▒ઠ ▒▒▒▒ 12.12.2016 0:43:59.
▒஥▒▒ "C:\Users\▒▒▒▒▒▒\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build\binding.sln" ▒ 㧫▒ 1 (楫▒▒▒ ▒▒ꥪ▒▒ ▒▒ 㬮▒砭▒▒).
ValidateSolutionConfiguration:
  ▒▒▒▒▒▒▒▒ ▒▒▒䨣▒▒樨 ▒襭▒▒ "Release|x64".
▒஥▒▒ "C:\Users\▒▒▒▒▒▒\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build\binding.sln" (1) ▒믮▒▒▒▒ ᡮ▒▒ "C:\Users\▒▒▒▒▒▒\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build\nslog.vcxproj" (2) ▒ 㧫▒ 1 (楫▒▒▒ ▒▒ꥪ▒▒ ▒▒ 㬮▒砭▒▒).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\▒▒▒▒▒▒\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build\nslog.vcxproj]
▒▒▒ઠ ▒஥▒▒ "C:\Users\▒▒▒▒▒▒\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build\nslog.vcxproj" ▒▒▒▒▒襭▒ (楫▒▒▒ ▒▒ꥪ▒▒ ▒▒ 㬮▒砭▒▒) ▒ ▒訡▒▒▒.
▒▒▒ઠ ▒஥▒▒ "C:\Users\▒▒▒▒▒▒\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build\binding.sln" ▒▒▒▒▒襭▒ (楫▒▒▒ ▒▒ꥪ▒▒ ▒▒ 㬮▒砭▒▒) ▒ ▒訡▒▒▒.

▒訡▒▒ ᡮન.

"C:\Users\▒▒▒▒▒▒\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build\binding.sln" (楫▒▒▒▒ ▒▒ꥪ▒ ▒▒ 㬮▒砭▒▒) (1) ->
"C:\Users\▒▒▒▒▒▒\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build\nslog.vcxproj" (楫▒▒▒▒ ▒▒ꥪ▒ ▒▒ 㬮▒砭▒▒) (2) ->
(▒▒▒▒▒▒▒ ▒▒ꥪ▒ Desktop_PlatformPrepareForBuild) ->
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\▒▒▒▒▒▒\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog\build\nslog.vcxproj]

    ▒।▒०▒▒▒▒▒: 0
    ▒訡▒▒: 1

▒▒▒▒祭▒▒▒ ▒६▒: 00:00:01.58
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:\Users\Родион\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Родион\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Родион\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\nslog
gyp ERR! node -v v7.0.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok

... and etc. related to electron-rebuild, that I want to install.

No matter how I install it - globally or locally. It throws error.

Possible cause

That may be familiar to this issue, because I have used "Recover" option on second-chance installation of VC++ Build Tools and it was successfully done, however some packages might silently fail? Idk.

People here argue different situations, but then this issue finally dropped and I see that they are still asking for help (2 months, 24 days and 2 days ago).

@vintprox vintprox changed the title Is there still lightweight Visual C++ Build Tools? MSBuild difficulties Dec 11, 2016
@AndrewPardoe
Copy link

VC++ Build Tools 2015 will fail install if VS 2015 is installed. This is a design issue, but also a technical issue. I completely endorse #1056 because the 2017 VS installer is designed to let you just lay down the tools you need. 

You should be able to install the C++ workload in VS 2015 or install the Win 8.1 SDK directly but LMK if you are blocked.

@vintprox
Copy link
Author

@AndrewPardoe Er, yes I have "Microsoft Visual Studio 14.0", what I was not expecting to see in my "Program Files". 😮

So that's the case - to make it clear, I need to remove VS 14.0 and all will be fine?

@AndrewPardoe
Copy link

I'm absolutely not an installer expert so I don't want to say "yes" :) I'm the compiler guy, but I want to help people get the compiler, thus, installer....

The intention is that the VC++ Build Tools are a lightweight alternative to the full VS 2015 install. If you've got VS 2015, you are blocked from installing the VC++ Build Tools. I don't think that just removing the VS 14.0 directory is sufficient, though. VS 2015 uses registry entries, etc. The build tools installer probably checks that. I think you have to actually uninstall VS 2015 to install the build tools. But VS 2015 is a superset of the build tools so you shouldn't actually need the build tools.

Note that this all gets simpler with VS 2017. You can have the build tools workload and the full VS workload sitting side by side.

@vintprox
Copy link
Author

vintprox commented Dec 11, 2016

@AndrewPardoe Thanks, now I've got idea! I remember that I have trying to install Visual Studio 2015 and suddenly aborted on 15%, these 10 Mbit/s were not enough to even install VS in two days, that might take a week.

Where can I find Visual Studio 2017 RC? According to release notes there is only Enterprise version, so I shouldn't use it in non-enterprise layer.

My next steps are:

  • Uninstall Visual C++ Build Tools
  • Uninstall Visual Studio 14.0 (accidentally uninstalled by VC++ Build Tools uninstaller)

@AndrewPardoe
Copy link

You can download the three main versions (Community, Professional, Enterprise) of 2017 RC here: https://www.visualstudio.com/vs/visual-studio-2017-rc/

You can also create an offline installation of the MS pieces (e.g., no Android SDK). Instructions are here: https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio

@vintprox
Copy link
Author

I'm not quite sure what to uninstall in my case:
image

There are lot of redistributables and only few of them are fresh. I'll definitely uninstall build tools, cause they might install wrongly.

@AndrewPardoe
Copy link

The redists are often installed by other software. I'd just leave those there. VS uninstall is unfortunately not very clean with 2015 :/

@vintprox
Copy link
Author

vintprox commented Dec 11, 2016

I have just uninstalled VC++ Build Tools via official uninstaller. Now "Microsoft Visual Studio 14.0" directory is missing, but "MSBuild" is still in "Program Files (x86)". Yeah, 2015 uninstall process is pretty dirty. However, that's not urgent.

Waiting for 2017 update of node-gyp 👍🎅 Good luck, @mousetraps @AndrewPardoe @joshgav and other contributors!

  • Install Visual Studio 2017
  • Try out node-gyp with VS 2017 tools

Mention me if testing needed.

@vintprox
Copy link
Author

vintprox commented Jan 2, 2017

I have installed VS2017 with Node.js tools and tryed to build node-gyp. All is unsuccessful.

@vintprox vintprox closed this as completed Jan 2, 2017
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

3 participants