npm config set C compiler not to vcbuild.exe - windows

When trying to npm install a node project in a Windows7 machine I am suffering from the inglorious error message:
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.
Because I am under Cygwin I have already installed gcc ($ gcc -v and $ g++ -v respond in both Cygwin and cmd).
How can I tell npm to use gcc to compile instead of the vcbuild.exe that I don't have installed?
Note: I have already tried node-gyp and it did not work.
Note2: I know for sure the code runs without problems in linux.

Here is what sorted out my problem and the steps that I took to reach the long-awaited solution:
Installed Visual Studio Community but the VCBuild.exe was not there still.
Installed Microsoft Build Tools 2015 and tried to install the affected module as: npm install bcrypt --msvs_version=2015 but I got the following error:
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".
My last shot was to install Visual Studio Express for Desktop and after npm install bcrypt --msvs_version=2015 I manage to npm install and npm start my app in Windows7!!
Lastly I uninstalled Visual Studio Community and Microsoft Build Tools 2015.
Note I had to remove the bcrypt module from the dependencies in package.json and install it as npm install bcrypt --msvs_version=2015 inside my app folder.

Related

Typescript version conflict in Visual Studio Code

I have an Angular2 project created with the angular-cli project templates in Visual Studio Code. Also, I installed the latest version of Typescript (2.0.3) via npm as well as via the Microsoft link (https://www.microsoft.com/en-us/download/details.aspx?id=48593) because I also use Visual Studio 2015. However, for some reason the I still get an error message when I start my Angular2 project. Note that even with a standard command prompt running tsc -v will still return 1.0.0.0.
How does tsc -v determine the version of typescript?
How do I get rid of this message in my Angular project and ensure
it will be using the latest version of Typescript?
What am I missing here? Appreciate your help.
If you only need the last version of TypeScript, on both Visual Studios, then you can
delete all previous installations which are located in: C:\Program Files (x86)\Microsoft SDKs\TypeScript.
reinstall the latest TypeScript version.
Hopefully everything will work.
Did you install TypeScript via NPM? If this is the case, try uninstalling it via npm uninstall -g typescript. Now reinstall it via npm install -g typescript and check if the problem is solved.
The best way is to allow VScode to only use the version of typescript installed locally.
Drop this in your .vscode/.settings file.
"typescript.tsdk": "./node_modules/typescript/lib"

What else npm can be used in Visual Studio 2015 besides of installing bower?

Context:
I am configuring my ASP.NET 4.x project to use bower to manage client side packages, using VS 2015 Update 2. (I am following this stackoverflow guide/answer
All cool. However after created bower.json, and seeing output I've noticed the following output line:
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\Bower.cmd" install --force-latest
This means that VS does not even use the npm installed bower (which is under the
/node_modules/bower) instead launching some globally installed (it was not me) bower.
Question:
What else npm can be used in Visual Studio 2015 ASP.NET project especially besides of installing bower?
In case of the answer is nothing, Question 2:
Can I just eliminate npm (package.json), and rely my bower.json in the Visual Studio project (and delete /node_modules)
The whole scenario also begs for the Question+:
Where should I configure Visual Studio to use the npm installed bower instead of the existing "global" installation in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\Bower.cmd
npm can also be used to install packages for Gulp or Grunt tasks, which can then be run by the Task Runner Explorer in VS 2015.
You can configure Visual Studio to use a different version of Bower in Tools->Options->Projects and Solutions->External Web Tools. Move $(PATH) to the top of the list to use a globally installed version, or add a new project-relative path to the top of the list.

How to find the typescript version that I'm using through CLI?

I installed typescript 1.7.4 via Visual Studio 2015. In Visual Studio I see that I installed version 1.7.4.
When I run the command tsc --version, I get 1.0.3.0, but not 1.7.4.
How can I find which version of Typescript installed through command line interface?
Run the command where tsc you will know where the 1.0.3.0 version is located, then you can remove it by whatever means. If you then install tsc using npm it will install the latest version (1.7.5 at the time of this writing).
I think you can check you environment path.Make sure C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.7 is in it.

Errors trying to install aglio with node.js

I am running Node.js 0.10.36 on my windows 7 machine. I also have grunt v0.4.5 and grunt-cli v0.1.13 installed. Python is 2.7.3 and Microsoft Visual studio is 2012.
I am trying to install aglio globally. The command I run is
npm install -g aglio
The error returned is as follows
I have been searching the internet for a good resolution to this, but I'm running out of things to try. The main suggestions were to install Python (which I've done) and to set Microsoft Visual Studio to 2012 (which I've also done).

error MSB3411: Could not l oad the Visual C++ component "VCBuild.exe"

I have Visual Studio 2010 with SP1 and Windows sdk 7.1.
I also have VS2012 and Windows kit 8.
when i run Windows SDK 7.1 Command Prompt and run node-gyp build --msvs_version=2010 it gives me error:
error MSB3411: Could not load the Visual C++ component "VCBuild.exe".
If the component is not installed,
either 1) install the Microsoft Windows SDK for Windows Server 2008 and .NET Fr
amework 3.5, or 2) install Microsoft Visual Studio 2008.
Is it trying to find VCBuild.exe.
I found that vcbuild has been replaced with msbuild.
Is it a valid error ?
I also found that in Windows 7, for .NET 3.5, you just need to turn it on from Control Panel. I have looked at other questions on stackoverflow like here and this.
But issue is that since vcbuild.exe does not exist in system with vs2010 then why does node-gyp is searching for it ? Or am i missing something ?
How do i resolve this error ?
The following has worked for me (as of June 2014), as described in here.
Install free Visual Studio Express 2013 for Windows (not VS Express 2013 for Web)
npm install --msvs_version=2013
Otherwise, I have spent a lot of time installing old Microsoft packages and patches, and it wasn't helpful.
Setting up the VS2010 and other applications as listed at node-gyp wiki solved the problems.
On Windows XP/Vista/7, node-gyp requires Python 2.7 and Visual Studio 2010
According to the readme file in Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1, to ensure that your system has a supported configuration,
uninstall the following products first (if you want to save tons of time)
and then reinstall them in the order listed: (you can uninstall in any order :P)
Visual Studio 2010
Windows SDK 7.1
Visual Studio 2010 SP1
Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1
On x64 environments, the last update in the list fixes errors about missing compilers and
error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found.
The answer to all your question lies here. Struggled a lot to find this. Finally got it working. =)
Just to save you time visiting the link here is what's useful in that link.
INSTRUCTIONS:
You can install with npm:
$ npm install -g node-gyp
You will also need to install:
On Unix:
python (v2.7 recommended, v3.x.x is not supported)
make A proper C/C++ compiler toolchain, like GCC
On Windows:
Python (v2.7.3 recommended, v3.x.x is not supported)
Windows XP/Vista/7: Microsoft Visual Studio C++ 2010 (Express version
works well)
For 64-bit builds of node and native modules you will also need the Windows > 7
64-bit SDK
If the install fails,
try uninstalling any C++ 2010 x64&x86 Redistributable that you have
installed first.
If you get errors that the 64-bit compilers are not installed you may
also need the compiler update for the Windows SDK 7.1
Windows 7/8:
Microsoft Visual Studio C++ 2012/13 for Windows Desktop (Express
version works well)
If you have multiple Python versions installed,
you can identify which Python version node-gyp uses by setting the
'--python' variable:
$ node-gyp --python /path/to/python2.7
If node-gyp is called by way of npm and you have multiple versions of
Python installed, then you can set npm's 'python' config key to the
appropriate value:
$ npm config set python /path/to/executable/python2.7
This can be fixed by installing all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated cmd (run as administrator).

Resources