3

I'm trying to install truffle from 2 days I don't know why error is coming in the same way I install truffle in my computer but in my laptopp when I'm trying it is showing an error I install Python 3.10 then visual studio build tools also but now I don't know why this error appears.

dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path C:\Users\HP\AppData\Roaming\npm\node_modules\truffle\node_modules\ganache\node_modules\@trufflesuite\bigint-buffer
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.3.0
npm ERR! gyp info using node@16.13.2 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.2 found at "C:\Python310\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version was set from command line or npm config
npm ERR! gyp ERR! find VS - looking for Visual Studio version 2015
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS checking VS2019 (16.11.32106.194) found at:
npm ERR! gyp ERR! find VS "D:\New folder"
npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features"
npm ERR! gyp ERR! find VS - found VC++ toolset: v142
npm ERR! gyp ERR! find VS - found Windows SDK: 10.0.19041.0
npm ERR! gyp ERR! find VS - msvs_version does not match this version
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS valid versions for msvs_version:
npm ERR! gyp ERR! find VS - "2019"
npm ERR! gyp ERR! find VS - "D:\New folder"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! System Windows_NT 10.0.10240
npm ERR! 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"
npm ERR! gyp ERR! cwd C:\Users\HP\AppData\Roaming\npm\node_modules\truffle\node_modules\ganache\node_modules\@trufflesuite\bigint-buffer
npm ERR! gyp ERR! node -v v16.13.2
npm ERR! gyp ERR! node-gyp -v v8.3.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Local\npm-cache\_logs\2022-01-27T06_07_10_995Z-debug.log
PS C:\Users\HP\Desktop>
Dharman
  • 30,962
  • 25
  • 85
  • 135
Sudhanshu
  • 31
  • 1
  • 2
  • Are you sure you tried all steps described in https://github.com/nodejs/node-gyp#on-windows? – eol Jan 27 '22 at 07:44

8 Answers8

5

I was facing exact same issue on node version 16 and got if finally resolved after I installed node -v v14.18.1 instead

0

I was also facing the same problem...

Solution:

  1. Run as administrator

  2. npm install --global windows-build-tools

  3. npm install -g truffle

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • error is solved i downgrade the node version to 12 and download git thenafter set the execution policy unrestricted soo my truffle installed and working also – Sudhanshu Jan 28 '22 at 20:41
0

I had the same problem.

You need to install the latest version of node, npm and python. The warnings will continue to appear but the installation of truffle will be successful.

It worked for me with the folowing versions:

  • node - v16.13.2
  • python - v3.9.10
  • npm - 8.4.1
Mayur Buragohain
  • 1,566
  • 1
  • 22
  • 42
0

Hope you have figured this out since it was over 2 weeks ago.

I had the same issue. However I had a feeling the whole time is was python related. I have never coded before watching hashlips and codestackr about a month ago.

So zero python experience and the logs you put looked very similar to mine.

How I fixed was I followed the guidelines in the extension section, under the python app, in the first section named details it gives very clear instructions on how to set up python correctly.

Start there if you are having this issue.

The Real USA MetaBert

Dharman
  • 30,962
  • 25
  • 85
  • 135
0

I also faced the same issue but using version its got resolved

npm install and use use truffle version @5.1.15 //as per your project requirement

0

Try to clear the cache:

npm cache clean -f

and install again.

Freddy Mcloughlan
  • 4,129
  • 1
  • 13
  • 29
0

I had the same issue. To be clear, you don't need to downgrade the node or npm version. The error you are facing is because you your system is not able to get the latest visual desktop C++ development. For achieving this you need to install visual studio code from here https://visualstudio.microsoft.com/vs/community/ Get the community one since it is free of use. And then install the latest version of desktop development with C++

Cheers! This should work.

0

Download the truffle version 5.0.2.No need to downgrade your node version.

Mehrose
  • 69
  • 2
  • 9