Why I get this error when I try to use npm install -g ganache-cli truffle in vs code? - npm

Why I get this error when I try to use npm install -g ganache-cli truffle in vs code?

You need to install the latest version of Visual Studio including the Desktop development with C++ workload. Remember Visual Studio is different from Visual Studio Code.
Basically workloads are like plugins and are easy to install once you have installed Visual Studio.

Related

Azure pipeline fails node-gyp error at yarn install task

I am running wdio test on azurepipelines on windows agent while upgrading from Node12 to Node14 getting error in yarn install any help is appreciated
you need to fix python libraries and install python in ur system i faced the same error a while ago , fixed it with re-installing python
We had to fix two things to resolve this as the above answer suggest I need to install python for all users in the azure agent
secondly I need to update the visual studio build tools to include the C++ development options

npm warn deprecated and npm errors

I tried to install truffle and all these deprecated messages and errors occured , i checked the npm modules version with 'npm-check -u' and it says it is all good.
I searched everywhere for a solution but nothing worked .
Iam looking for your help ,thanks in advance .
view code error
From the error message, it suggests you to install visual studio, which will install C and C++ tools. For the most part, those warnings do not mean much, as this is a local development framework, and I get them on the windows truffle install as well, but i am not sure why, but node-gyp wants a C compiler. here is the link to visual studio: https://visualstudio.microsoft.com/free-developer-offers/

hiredis rebuild with .net framework 2.0 error

I tried remove and install the related files for .net framework 3.5 (include the 2.0). Suggested in this stackoverflow
Tried to install visual studio 2005 as suggested in the second thing that was suggested in the error.
I cannot find hiredis folder under node_modules.
Other thing I tried to clean my cache and delete node_modules and reinstall again as suggested in this stackoverflow.
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.
[D:\path\src\node_modules\hiredis\build\binding.sln]
The full error find in the image.
This apparently is a common error people come across as a window user.
If you are recently update your Visual studio to a new version such as 2012 and above will see similar from the above.
There are articurs on this, if you use the right search keys, here is one of them and the author explains it in details. link
three solutions:
1) npm install -g windows-build-tools stackoverflow
2) install visual studio 10 -> npm clear cache --force -> delete node_modules/ -> delete package-lock.js npm config set msvs_version 2010 -g
3) manually download the neccaries files then npm config set msvs_version -g github

Gulp sass returning Error: python2 not found

This is what I see when I try to install gulp-sass like this:
npm i gulp-sass --save-dev
Running gulp-watch and gulp browser-sync works
TIA
As the error message suggests you probably don't have python installed. The node-sass library compiles the libsass from source. For that it uses node-gyp. To build under windows the readme suggests:
On Windows
Option 1
Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).
Option 2
Install tools and configuration manually:
Install Visual C++ Build Environment: Visual Studio Build Tools (using "Visual C++ build tools" workload) or Visual Studio 2017 Community (using the "Desktop development with C++" workload)
Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7 (or see below for further instructions on specifying the proper Python version and path.)
Launch cmd, npm config set msvs_version 2017
If the above steps didn't work for you, please visit Microsoft's Node.js Guidelines for Windows for additional tips.
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

React-Native Install Error

ling react-native I get the following error (on windows)
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(31):
error C2373: '__pfnDliNotifyHook2': redefinition; different type modifiers
[C:\Projects\JustEatLife\node_modules\react-native\node_modules\ws
\node_modules\bufferutil\build\bufferutil.vcxproj]
I've installed windows sdks, added the C++ tools to my VS 2015 installation, installed android studio, java etc.
Is there any way to resolve this?
I got same problem, and for me the answer was to update node-gyb from version 3.3.1 to 3.4.0 in npm.
For instructions how to do it, see:
npm install fails with error C2373 with vs2015 update 3
If npm i fails, try npm install node-gyp after you have updated version number in packages.json