Socket.io installation failed | Windows 7 64bit - node.js

I have installed NodeJs and the module 'express'. Now I want to istall socket.io, but it doesn't work. I've tried differend NodeJS versions, but all installations failed.
Here is the log: http://pastebin.com/T8ZZRTML
Here is a screenshot: http://www10.pic-upload.de/31.01.13/ld98apo58e.jpg

Looks like a native addon build error. Do you have a proper build environment set up?
Python (v2.7.3 recommended, v3.x.x is not supported)
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

Related

Must I install NodeJS when it is already installed by the Visual Studio Installer?

Info
I am using Visual Studio 2019.
The Microsoft guides for creating SPA's requires you to install NodeJS from the official website, at least the guides I have perused so far.
When I installed Visual Studio I selected NodeJS development.
Visual studio installed NodeJS here: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\NodeJs
Question
My goal is to use NodeJS for development and NOT interfere with the operation of Visual Studio AND to only have one version of NodeJS installed AND to avoid installing NVM.
Must I install NodeJS again or should I use the version installed by Visual Studio?
It also raises the following concerns, which I don't expect to get answered here, but it would be nice to know:
If I install it again, will conflicts occur between the two versions?
If conflicts occur, how do I resolve them?
If I use the one installed by Visual Studio, can I update it at will, or does Visual Studio require a specific version of NodeJS?
See also
Multiple versions of node on windows
Install different versions of NodeJS
There was a question posted to the Microsoft Developer Community forums that also addresses this question. Quote:
Thank you for reporting this feedback. The NodeJS workload doesn’t install the Node Runtime and NPM on it’s own. The install you mentioned in the Visual Studio folder is used internally for Visual Studio operations. You would need to install the runtime you want to use separately, which would be picked up by NodeJS workload and corresponding apps.
In response to your question:
Must I install NodeJS again or should I use the version installed by Visual Studio?
Yes - so while it seems a whole separate copy of Node.js and npm is installed under C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VisualStudio\NodeJs when you install Visual Studio (with the Node.js workload), you are meant to install the regular version of Node.js and npm from https://nodejs.org/ and use that in your day-to-day development activities, which is what I've been doing (except with VS2022) and have not encountered any conflicts so far.
Edit: IF you do encounter conflicts with installed Node.js or npm versions, there is a way to resolve them, by changing the order of precedance of paths that VS uses. Go to 'Tools -> Options -> CTRL+E: "External Web Tools"' and you should see this:
Move the $(PATH) entry up or down depending on which version should take priority.
You can check if NodeJS is installed or not using the node -v and check if npm package manager is installed using npm -v. If you find that NodeJS is not installed, then download the NodeJS from here.

npm install bcrypt on Windows Server 2012

I'm getting this error when trying to install my node modules for my node server.
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.
[C:\inetpub\wwwroot\PearsonRealty- API\node_modules\bcrypt\build\binding.sln]
I've tried to install the .NET Framework 2.0 SDK, but it just exits out and never runs. I can't install Microsoft Visual Studio since I'm on an AWS EC2 instance and I wouldn't have enough space for it. Any help would be awesome, thanks.
You do need to install either VCExpress (preferrably at least 2015) or you can try the experimental VC Build Tools solution which is a smaller install than full-blown VCExpress. Otherwise, if you have one, you can try building on a local Windows machine first and then uploading the compiled addon directory to AWS.

while installing vc_redist.x64.exe, getting error "Failed to configure per-machine MSU package."

While I am trying to install vc_redist.x64.exe on Windows 8.1
getting following error:
Failed to configure per-machine MSU package.
Posting answer to my own question as I found it here and was hidden in bottom somewhere -
https://social.msdn.microsoft.com/Forums/vstudio/en-US/64baed8c-b00c-40d5-b19a-99b26a11516e/visual-c-redistributable-for-visual-studio-2015-rc-fails-on-windows-server-2012?forum=vssetup
This is because the OS failed to install the required update Windows8.1-KB2999226-x64.msu.
However, you can install it by extracting that update to a folder (e.g. XXXX), and execute following cmdlet. You can find the Windows8.1-KB2999226-x64.msu at below.
C:\ProgramData\Package Cache\469A82B09E217DDCF849181A586DF1C97C0C5C85\packages\Patch\amd64\Windows8.1-KB2999226-x64.msu
copy this file to a folder you like, and
Create a folder XXXX in that and execute following commands from Admin command propmt
wusa.exe Windows8.1-KB2999226-x64.msu /extract:XXXX
DISM.exe /Online /Add-Package /PackagePath:XXXX\Windows8.1-KB2999226-x64.cab
vc_redist.x64.exe /repair
(last command need not be run. Just execute vc_redist.x64.exe once again)
this worked for me.
I would like to give you a background on Universal CRT this would help you in understanding as to why the system should be updated before installing vc_redist.x64.exe.
A large portion of the C-runtime moved into the OS in Windows 10 (ucrtbase.dll) and is serviced just like any other OS DLL (e.g. kernel32.dll). It is no longer serviced by Visual Studio directly. MSU packages are the file type for Windows Updates.
In order to get the Windows 10 Universal CRT to earlier OSes, Windows Update packages were created to bring this OS component downlevel. KB2999226 brings the Windows 10 RTM Universal CRT to downlevel platforms (Windows Vista through Windows 8.1). KB3118401 brings Windows 10 November Update to the Universal CRT to downlevel platforms.
Windows XP (latest SP) is an exception here. Windows Servicing does not provide downlevel packages for that OS, so Visual Studio (Visual C++) provides a mechanism to install the UCRT into System32 via the VCRedist and MSMs.
The Windows Universal Runtime is included in the VC Redist exe package as it has dependency on the Windows Universal Runtime (KB2999226).
Windows 10 is the only OS that ships the UCRT in-box. All prior OSes obtain the UCRT via Windows Update only. This applies to all Vista->8.1 and associated Server SKUs.
For Windows 7, 8, and 8.1 the Windows Universal Runtime must be installed via KB2999226. However it has a prerequisite update KB2919355 which contains updates that facilitate installing the KB2999226 package.
Why does KB2999226 not always install when the runtime is installed from the redistributable? What could prevent KB2999226 from installing as part of the runtime?
The UCRT MSU included in the VCRedist is installed by making a call into the Windows Update service and the KB can fail to install based upon Windows Update service activity/state:
If the machine has not updated to the required servicing baseline, the UCRT MSU will be viewed as being “Not Applicable”.
Ensure KB2919355 is installed. Also, there were known issues with KB2919355 so before this the following hotfix should be installed.
KB2939087
KB2975061
If the Windows Update service is installing other updates when the VCRedist installs, you can either see long delays or errors indicating the machine is busy.
This one can be resolved by waiting and trying again later (which may be why installing via Windows Update UI at a later time succeeds).
If the Windows Update service is in a non-ready state, you can see errors reflecting that.
We recently investigated a failure with an error code indicating the WUSA service was shutting down.
To identify if the prerequisite KB2919355 is installed there are 2 options:
Registry key:
64bit hive
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB2919355~31bf3856ad364e35~amd64~~6.3.1.14
CurrentState = 112
32bit hive
HKLM\SOFTWARE\[WOW6432Node\]Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB2919355~31bf3856ad364e35~x86~~6.3.1.14
CurrentState = 112
Or check the file version of:
C:\Windows\SysWOW64\wuaueng.dll
C:\Windows\System32\wuaueng.dll
is 7.9.9600.17031 or later
I faced a similar problem but in my case I was trying to install Visual C++ Redistributable for Visual Studio 2015 Update 1 on Windows Server 2012 R2. However the root cause should be the same.
In short, you need to install the prerequisites of KB2999226.
In more details, the installation log I got stated that the installation for Windows Update KB2999226 failed. According to the Microsoft website here:
Prerequisites To install this update, you must have April 2014 update
rollup for Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2
(2919355) installed in Windows 8.1 or Windows Server 2012 R2. Or,
install Service Pack 1 for Windows 7 or Windows Server 2008 R2.
Or, install Service Pack 2 for Windows Vista and for Windows Server
2008.
After I have installed April 2014 on my Windows Server 2012 R2, I am able to install the Visual C++ Redistributable correctly.
The OS failed to install the required update Windows8.1-KB2999226-x64.msu.
However I tried to find the particular update from -
C:\ProgramData\Package Cache\469A82B09E217DDCF849181A586DF1C97C0C5C85\packages\Patch\amd64\Windows8.1-KB2999226-x64.msu.
I couldn't find it there so I installed the kb2999226 update from here (Windows 10 Universal C runtime)
Then I installed the update according to my OS and after that It was working fine.
In my case and while installing VS 2015 on Windows7 64x SP1, I experienced the same so tried to cancel and download/install the KBKB2999226 separately and for some reason the standalone update installer also get stuck searching for updates.
Here what I did:
When the VS installer stuck at the KB2999226 update I clicked cancel.
Installer took me back to confirm cancellation, waited for a while then opened the windows task manager and ended the process of wuse.exe (windows standalone update installer)
On the VS installer clicked "No" to return to installation process. The process was completed without errors.
I also got that error when trying to install the Visual C++ 2015 Redistributable on my Windows 7 SP1 machine.
I solved my problem by installing the Visual C++ 2015-2019 Redistributable from here https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0

Error on installing karma test runner

When I trying to install karma on windows 7. I am getting following 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 Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere. [C:\Users\user\AppData\Roaming\npm\node_modules\karma\
node_modules\socket.io\node_modules\socket.io-client\node_modules\ws\build\bind
ing.sln]
I installed .NET Framework 2.0 Software Development Kit (SDK) (x86) . still getting same error
Keep
Calm
and
Continue
Using
Karma
Here's the Karma owner's (Vojta Jina) comment on the issue:
this is just optional compilation of native module to speed things up.
Even without native module it will still work.
In any case, not a Karma issue, so closing. If you want to compile
native modules, use linux/mac ;-)
Btw. regarding your getting the same error even after SDK install, possibly VCBuild.exe and/or C++ compiler is not added to path.

node js websocket requires c++

I want to install:
npm install websocket
and I get the message:
Native code compile failed!!
On Windoes, native extensions require Visual Studio and Python
Then I installed Visual Studio 8 and Python, but I still get the message.
How can Visual Studio compile the code?
Are you installing correct versions of them. From the websocket npm page :
Note for Windows Users
Because there is a small C++ component used for validating UTF-8 data,
you will need to install a few other software packages in addition to
Node to be able to build this module:
Microsoft Visual C++
Python 2.7 (NOT Python 3.x)
Software to be installed are visual-cpp-express 2010 and python 2.7

Resources