Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1

i am trying to install all dependencies using npm install command, but while installing it i am getting error like below :

ling source file ..\src\threaded_callback_invokation.cc)
c:\applatest\applatest\node_modules\nan\nan.h(1478): warning C4996: 'node::MakeCallback': was declared deprecated (comp
iling source file ..\src\threaded_callback_invokation.cc) [C:\appLatest\appLatest\node_modules\voicemeeter\node_modules
\ffi\build\ffi_bindings.vcxproj]
  c:\users\alliancetek\.node-gyp\10.15.0\include\node\node.h(176): note: see declaration of 'node::MakeCallback' (compi
  ling source file ..\src\threaded_callback_invokation.cc)
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\appLatest\appLatest\node_modules\voicemeeter\node_modules\ffi
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\7zip-bin-linux):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\7zip-bin-mac):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\alliancetek\AppData\Roaming\npm-cache\_logs\2019-02-05T10_40_31_378Z-debug.log

in many of solutions i got try npm install node-gyp or uninstall or install it again but in that i am getting same error.

Also try with this steps:

  • Install the latest versions of Python (it may not be related😅), and "Microsoft Visual C++ Redistributable for Visual Studio 2017", and of course, Node.js and NPM;
  • As Admin: $ cd "C:\Program Files\nodejs\node_modules\npm" $ npm install node-gyp
  • $ npm config set msvs_version 2015 --global Note that I have VS 2017, but configuring it as ver 2017 won't work. Not sure why.
  • As Admin: $ npm install -g node-sass And finally, one last check: $ node-sass -v

and try with npm install --production windows-build-tools but getting no result by any option.

tried with every solution but none of the working. i have installed python with 2.7.15, vc++ building tools, visual studio 2017 and all required components.

I am finding solution from last 2 weeks please suggest me correct answer

like image 601
sejal Avatar asked Feb 05 '19 10:02

sejal


People also ask

Where is MSBuild 15 located?

MSBuild is now installed in a folder under each version of Visual Studio. For example, C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild. You can also use the following PowerShell module to locate MSBuild: vssetup. powershell.

Where is MSBuild exe installed?

For a typical default installation on Windows 10, MSBuild.exe is under the installation folder in MSBuild\Current\Bin.


Video Answer


3 Answers

  1. run: npm cache clean --force
  2. delete node_modules
  3. delete packagelock.json and yarn.lock(if have)
  4. run: npm install
like image 88
Shubham Tiwari Avatar answered Oct 09 '22 08:10

Shubham Tiwari


None of these answers worked for me on Windows 10 and Node 13. I had to uninstall Visual Studio and Build Tools, and uninstall Node 13. Then, I deleted npm and npm-cache from Roaming, before reinstalling Node 11.6 and choosing to install Chocolately. It worked for me thereafter.

like image 35
user5305519 Avatar answered Oct 09 '22 06:10

user5305519


  • Run npm install --production windows-build-tools might take longer to install, worked for my friend

OR

  • Reinstalling nodeJs worked for me
like image 33
Debu Shinobi Avatar answered Oct 09 '22 07:10

Debu Shinobi