trufflesuite / ganache

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
2.62k stars 678 forks source link

leveldown@5.6.0 should be updated to latest to work in Windows 11 #1966

Closed Fatorin closed 2 years ago

Fatorin commented 2 years ago

I try install 7.0.0beta2 in my computer, but get some error message.

It issue because Visual Studio 2022 can't be found by node-gyp 8.3.0.

I try update node-gyp version to latest, but didn't work, it still used 8.3.0 to build.

How can I fix this problem?

PS C:\Users\Fatorin\Desktop\react> npm install ganache@beta --global
npm ERR! code 1
npm ERR! path C:\Users\Fatorin\AppData\Roaming\npm\node_modules\ganache\node_modules\leveldown
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.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.2 found at "C:\Users\Fatorin\AppData\Local\Programs\Python\Python39\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
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 **************************************************************
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.22471
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\Fatorin\AppData\Roaming\npm\node_modules\ganache\node_modules\leveldown
npm ERR! gyp ERR! node -v v16.13.1
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\Fatorin\AppData\Local\npm-cache\_logs\2022-01-03T07_55_59_579Z-debug.log
davidmurdoch commented 2 years ago

What version of windows are you using?

Fatorin commented 2 years ago

What version of windows are you using?

Win11 22471.1000

davidmurdoch commented 2 years ago

Hm, ganache ships with pre-built Windows binaries for leveldown. Can you try to npm install leveldown and let me know if it works for you?

Fatorin commented 2 years ago

Hm, ganache ships with pre-built Windows binaries for leveldown. Can you try to npm install leveldown and let me know if it works for you?

I install leveldown success but ganache still install fail.

davidmurdoch commented 2 years ago

Hm, that's interesting. Ganache's version of leveldown is 5.6.0, which is not latest. Perhaps leveldown has fixed something in a recent version.

Can you try npm install leveldown@5.6.0 and let me know if it works?

Fatorin commented 2 years ago

Hm, that's interesting. Ganache's version of leveldown is 5.6.0, which is not latest. Perhaps leveldown has fixed something in a recent version.

Can you try npm install leveldown@5.6.0 and let me know if it works?

It still can't work.

I try a other way, install new NodeJS version(17.3.0) and try install ganache again. But I get new errors. Maybe I should use Linux to set up my development environment.

davidmurdoch commented 2 years ago

It still can't work.

Ok, so it sounds like the version of leveldown Ganache ships with is incompatible with Windows 11. We'll try to update this to fix it in a release soon!

davidmurdoch commented 2 years ago

@Fatorin A new release just went out. Can you try it on Windows 11? Run npm install --global ganache@rc to install globally

Fatorin commented 2 years ago

@Fatorin A new release just went out. Can you try it on Windows 11? Run npm install --global ganache@rc to install globally

I install success!!! And it can work, thanks you!

davidmurdoch commented 2 years ago

Awesome! Thanks for giving it a try.

I'll close this issue since I looks like it's been solved. Let us know if you find any other issues.

Grantmac75 commented 2 years ago

Hi David, Still getting a similar issue when I ran C:\Users\gmac7\demos\web3_py_simple_storage>npm install --global ganache@rc.

No idea what I am doing sorry.

davidmurdoch commented 2 years ago

Install ganache@latest instead. 😁

Grantmac75 commented 2 years ago

Install ganache@latest instead. 😁

Hah yeah that's what I had done first and thought this might have fixed my issue. It might be I need the latest visual studio so I am going to try that. That's the only think I can think of.