question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

msbuild error MSB4025

See original GitHub issue

I’m using Windows 10, node 7.7.2, npm 4.1.2

I get this error when running node-gyp rebuild for after installing the binding module leveldown (My objective is to rebuild it for electron). The specific error is…

MSBUILD : error MSB4025: The project file could not be loaded. Root element is missing.

I searched for this error but it seemed to be specific to visual studio projects and xml files. I don’t have a lot of context since I’m not usually a windows user. Somewhere I found that you can specific --msvs_version=2013, that did not work. But I tried with 2017 (because that’s the latest download) and I got the following error.

Traceback (most recent call last):
  File "C:\Users\Gebruiker\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "C:\Users\Gebruiker\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "C:\Users\Gebruiker\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 538, in main
    return gyp_main(args)
  File "C:\Users\Gebruiker\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 514, in gyp_main
    options.duplicate_basename_check)
  File "C:\Users\Gebruiker\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 98, in Load
    generator.CalculateVariables(default_variables, params)
  File "C:\Users\Gebruiker\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1900, in CalculateVariables
    generator_flags.get('msvs_version', 'auto'))
  File "C:\Users\Gebruiker\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.py", line 434, in SelectVisualStudioVersion
    versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)
KeyError: '2017'

If anyone has any idas I would be very grateful! -S

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:14
  • Comments:65 (26 by maintainers)

github_iconTop GitHub Comments

16reactions
refackcommented, Apr 18, 2017

Except it uses the msbuild.exe on the path by default, so you need to either ensure the v14.0 msbuild in %PROGRAM_FILES(x86)%\MSBuild\v14.0\Bin is the one it finds, or install the v140 C++ toolchain in VS 2017. Ugh.

3.6.0 supports VS2017 You can install Build Tools for Visual Studio 2017, make sure to select C++ tools, Windows 10 SDK and MSBuild and your set.

This bug can be closed /cc @rvagg

Edit

for node-gyp@3.6.0 do not install any of the special SDKs (red) only any of the greens image P.S. you only need one, and best tested is 10393

6reactions
endnchcommented, Dec 31, 2018

I solved this error by running npm install --global --production windows-build-tools --vs2015 (note the --vs2015)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error MSB4025: The Project File Could Not Be Loaded
A project file could not be loaded ! This is a problem that occurs with the following file or directory: MSB4025_PROJECT.MDBD.
Read more >
MSBUILD Error MSB4025 in TeamCity build ... - Stack Overflow
Error: error MSB4025: The project file could not be loaded. Data at the root level is invalid. I launched cmd as Administrator and...
Read more >
error MSB4025: The project file could not be loaded. Data at ...
MSBUILD : error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1 #834....
Read more >
Visual Studio 2019 16.8.7 cannot build solution files with ...
7, we cannot build solution files with MSBuild anymore. The following error occurs: error MSB4025: The project file could not be loaded. Data...
Read more >
How to solve error MSB4025 - CodeProject
Um. That doesn't look right at all: HTML. <project defaulttargets="Build"> xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found