NPM Install on Windows 7 issue, no Microsoft.CPP folder - c++

I'm having troubles with npm install on Windows 7.
I'm using Visual Studio 2013 Express and I've also installed Microsoft Build Tools 2013.
I have the Path variable set and I've tried with the --msvs_version parameter in the npm install
It gives me the
error MSB4019: "C:\Program Files (x86)\MSBuild\12.0\Microsoft.Cpp.Default.props" not found
That folder doesn't exist on my computer, I only have
MSBuild\12.0
and
MSBuild\Microsoft
What do I miss to install?? I would be able to compile Node project without having to install the full version of VS, if possible, and honestly, I would be able to do it by installing the minimum required software.
Thank you!

Related

"error MSB8020: The build tools for v141 (Platform Toolset = 'v141') cannot be found" when trying to install npm module scrypt

I´m trying to install the npm module scrypt.
I know scrypt requires node-gyp, i installed it globally (several times). Also I know node-gyp requires python 2.7 and MS Build Tools. I installed the latest python 2.7 build and i installed MS Build Tools. I also tried with VS Community Edition 2017. I tried to repair and reinstall both.
I also installed npm package windows-build-tools (several times) globally successful.
But wenn i try npm i scrypt i got the following errors:
C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5):
error MSB8020: The build tools for v141 (Platform Toolset = 'v141')
cannot be found. To build using the v141 build tools, please install
v141 bu ild tools. Alternatively, you may upgrade to the current
Visual Studio tools by selecting the Project menu or right-click the
solution, and then selecting "Retarget solution".
[c:\project\node_modules\scrypt\build\copied_files.vcxproj] C:\Program
Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5):
error MSB8020: The build tools for v141 (Platform Toolset = 'v141')
cannot be found. To build using the v141 build tools, please install
v141 bu ild tools. Alternatively, you may upgrade to the current
Visual Studio tools by selecting the Project menu or right-click the
solution, and then selecting "Retarget solution".
[c:\project\node_modules\scrypt\build\scrypt_wrapper.vcxproj]
Any tips or suggestions?
After a few more hours, i found out there was an old installation of visual studio 2015. I had to uninstall it first. I have no clue, why not the newest instance of build tools was used.
After this, and downgrading Node to v8, scrypt could be installed and compiled again.
I guess what fixed it for smonkey, who uninstalled an older installation of Visual Studio, was that that uninstall process also removed that old MSBuild path from %PATH%.
Because for me, just removing that old MSBuild.exe from the path fixed it. node-gyp does not need MSBuild on the path, but it gets tripped up if there is one on the path that's too old for the build target.
So either delete your MSBuild path, or make sure it points to the latest version. Unless of course you wanted to uninstall Visual Studio anyway, but that is not an option for some.
Just had this issue. Removing (or unsetting) the VCTargetsPath system variable fixed it for me. I think it was created by a previous VS2015 install, but removing VS2015 did not remove the variable.
(Ken Pespisa already posted this in a comment, but I missed it on a previous visit to this page. I am adding it as an answer so people can find it more easily.)

error: command 'C:\\ Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

Hi so I was trying to pip install python-ldap using my git bash but at first it told me that i don't have cl.exe so i downloaded the visual studio C++ pack now it's showing this error
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
I never coded with C++ so I'm not sure what the error is. I downloaded the CLI tools for C++ too and I don't think it's because the cl.exe isn't in the path since it found it. Any insights ??
Install Visual C++ 2015 Build Tools from https://go.microsoft.com/fwlink/?LinkId=691126 with default selection.
I know this question was asked years ago, but for future users, I thought of providing an answer for this question. Today I've faced the same problem with the "Microsoft visual studio 2019 build tool."
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30037\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
I have come across this issue while trying to install the dependency through anaconda3 cmd in windows OS.
pip install sparse_dot_topn
I have tried different methods suggest in different portals and couldn't resolve this for hours. At the same time, I've ended up installing unnecessary components of the visual studio build tool as well. Finally, I found the problem is associated with the setup tool library, and the problem can be solved through force upgrade to the setup tool package
python -m pip install -U pip setuptools
There doesn't seem to be a valid solution for this error but one workaround is to install the windows binary package from https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap
In my case, I had to copy or link (using link shell extension) the x64 version of "C Connector" to the x86 folder.
If you can't find the x64 C connector...
Download mysql-installer-web-community-8.0.12.0.msi from their website:
https://dev.mysql.com/downloads/installer/
Run the Installer, and click the Add button on the right, then locate the Connector C 6.1 x64
The C++ Connector has C compatible header files, but hard-linking to it does not work, as explained here: https://dev.mysql.com/downloads/connector/c/
You cannot install the x86 version alongside the x64 version. The installer does not permit this.
Otherwise, Hard-Link the x64 version
Install link shell extension.
Navigate to "C:\Program Files\MySQL\" then right click on "MySQL Connector C 6.1" and click Pick Link Source
Navigate to "C:\Program Files (x86)\MySQL\" and Drop Link As... > Junction
A Junction is a duplicate reference in the file system to a folder. Creating a second junction reclassifies the original folder a junction as well, but they are both authentic references to the same folder, and so, unlike symbolic links, they will work with scripts, because they are real, and are implemented on the file system level.
Then, if the connector you have installed is a different version number and you want to try to force it to work with a non-compatible script, rename it to match the folder mentioned in the error message. For example...
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726
\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,3,13,'final',0) -D__version__=1.3.13 "-I C:\Program Files (x86)\MySQL\MySQL Connector C 6.1 \include" "-Ic:\program files\python37\include" "-Ic:\program files\python37\include" "-IC:\Program Files (x86)\Microsoft Visu...
Crappy pip code failing to pass variables from the system environment :(
I had a similar issue.
I had installed a 32-bit python interpreter from https://www.python.org/downloads/windows/ mistakenly in my 64-bit windows machine.
Then I downloaded the correct 64-bit interpreter setup and installed it. Then I pointed the Pycharm interpreter path to it.
Then my issue was solved. I hope this will help you...
When I was perusing the internet to find the solution I ran into an adjacent problem:
Python was not found, which I solved by (assuming your python works and is added to PATH) going to Settings > Manage App Execution Aliases and turning off "python". They try installing your package again
Install the C++ build tools from here: https://my.visualstudio.com/Downloads
Search for 'build tools' and download the latest VS build tools installer. Install the C++ build tools (currently it's called "Desktop Development with C++") with the defaults.
What worked for me in the same situation: Except installing VS Build Tools, install whole Visual Studio. Python libs often require C/C++ compiler
I had the same error; although when installing lux-api
What worked for me was downgrading the default python version 3.10 -> 3.9
(ref)
p.s. the error that I had was the following
error: command ...\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for pandas
Failed to build pandas
ERROR: Could not build wheels for pandas, which is required to install pyproject.toml-based projects
I had the similar issue. I was trying to build pandas from source. I figured out that my build tools were not compatible with the source. I had MSVC v142 installed. So I installed the below components and this worked for me:
Windows 10 SDK (10.0.17763.0)
MSVC v141 - VS 2017 C++x64/x86 build tools
These tools can also be installed from cmd, just install visual studio 2019 build tools exe and then run this command in cmd as admin:
vs_buildtools.exe --quiet --wait --norestart --nocache ^
--installPath C:\BuildTools ^
--add "Microsoft.VisualStudio.Workload.VCTools;includeRecommended" ^
--add Microsoft.VisualStudio.Component.VC.v141 ^
--add Microsoft.VisualStudio.Component.VC.v141.x86.x64 ^
--add Microsoft.VisualStudio.Component.Windows10SDK.17763
I also had to install additional tools to make it work correctly:
C++/CLI Support for v141 build tools (14.16)
Once the tools were installed correctly then I had to initialize x64 environment with new installed build tools:
"C:\BuildTools\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.16 10.0.17763.0
After that I restarted my computer and build pandas again and it was build successfully.

Set-DefaultScaffolder : Could not find scaffolder 'Mailer.Razor' in Visual Studio 2017 and MVC Mailer 4.0.5

Under Visual Studio 2017 while installing MVCMailer 4.5.0 I encounter the following error:
Set-DefaultScaffolder : Could not find scaffolder 'Mailer.Razor'
It turns out that when the MVC Mailer package is installed it is installed as 'MvcMailer.4.5' in the packages directory however the manifest must list it as 'MvcMailer.4.5.0'. When searching for the Mailer.Razor.ps1 script it is looking in the MvcMailer.4.5.0\tools directory but it can't find it because that folder does not exist so the scaffolder can not be set correctly.
The workaround is to install the package with the error. Then go to the packages directory and make a copy of the 'MvcMailer.4.5' folder and rename it to 'MvcMailer.4.5.0' then uninstall and reinstall the package - this time it will install without any errors and the default Mailer scaffolder will be set correcty.

TeamCity Unmet requirements: MSBuildTools14.0_x86_Path exists

I have a solution built in VS 2015 and need to set up TeamCity to run it.
I have installed a build agent on a Virtual Machine, but TeamCity marks all the build profiles for this build agent as incompatible and gives the following error:
Unmet requirements:
MSBuildTools14.0_x86_Path exists
I have installed MSBuild Tools 2013. Please advise what to do. Thank you.
You need to download Microsoft Build Tools 2015 from this link -https://www.microsoft.com/en-us/download/details.aspx?id=48159 and make sure path is added in System Variable
Thank you. I used chocolatey tool to install MSBuild Tools packages. It installed the latest version for VS 2017, but my solution was built in VS 2015. So I uninstalled the package and then installed again. It resolved the problem.

Node packages not building on Windows 8.1 - Missing Microsoft.Cpp.Default.props

NPM packages are not building on Windows 8.1 - failing with following error,
error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
I have tried the following,
Setting an evironment variable VCTargetsPath to C:\Program Files (x86)\MSBuild\12.0\ (The error changes accordingly but there is no Microsoft.Cpp.Default.props with the 2012 build tools).
Installing a VisualStudio 2010 environment (uninstalled then installed in the correct order) according to this answer
Completely removed VisualStudio 2010 and tried a VisualStudio 2012 instead, which should work according to the Node-gyp wiki
Added registry keys according to this answer
Tried using the Windows 7.1 SDK command prompt according to this answer
Tried setting VisualStudioVersion before running npm according to this answer
Tried passing --msvs_version=2012 to npm according to this answer
None of the above have worked.
I've spent ages on this already. Does anyone have a definite answer that works?
The quick fix for me was this:
set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120
npm install
Finally Microsoft is providing much better solution to VS.
I just wanted to update this question with the latest answer. You now do not need to install Visual Studio.
Source: https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245
Instructions below in case the source goes down.
Install VC++ Build Tools Technical Preview using the Default Install option.
[Windows 7 only] requires .NET Framework 4.5.1
Install Python 2.7, and add it to your PATH: npm config set python python2.7
Launch cmd and run:
npm config set msvs_version 2015 --global (this is instead of lnpm install [package name] --msvs_version=2015l every time.)
So it is 2.47am - figured it out.
Although the node-gyp site seems to suggest using Visual Studio 2010 or 2012, instead for Windows 8.1, install Visual Studio Express 2013 for Windows Desktop as discussed in this issue.
Setting the following fixed the problem for me
/property:VCTargetsPath="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120
As mentioned on this forum
A quick note for people who installed:
Visual Studio 2012 (Express)
MSBuild 2012
with the issue of:
MSBuild loads Microsoft.Cpp.Default.props
MSBuild cannot load Microsoft.Cpp.props
The solution is here:
set parameter of MSBuild:
/property:VCTargetsPath="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110"
This is the same issue as described here
NPM native builds with only Visual Studio 2013 installed
If you have a version of VS2013 installed set this environment variable before running the npm command:
set GYP_MSVS_VERSION=2013
or for VS2012
set GYP_MSVS_VERSION=2012
background reading: https://github.com/Automattic/socket.io/issues/1151
Just in case people encounter this issue again, the issue got resolved in my case when I did a
npm install -g --production windows-build-tools
Link for reference
Related question