electron/rebuild

Could not find any Visual Studio installation to use

codestitch opened this issue · 11 comments

Environment details

  • OS: windows
  • OS version: 11
  • node-pty version: 0.10.1
  • electron: 20.1.4
  • xterm: 4.2.0
  • electron-rebuild: 3.2.9

Issue description

Tried building from the example (node-pty/examples/electron). It worked!
However, when upgrading electron and other libs would wouldn't work.

./npm-install.sh

# Electron's version.
export npm_config_target=20.1.4
# The architecture of Electron, can be ia32 or x64.
export npm_config_arch=x64
export npm_config_target_arch=x64
# Download headers for Electron.
export npm_config_disturl=https://www.electronjs.org/headers
# Tell node-pre-gyp that we are building for Electron.
export npm_config_runtime=electron
# Tell node-pre-gyp to build module from source code.
export npm_config_build_from_source=true
# Install all dependencies, and store cache to ~/.electron-gyp.
HOME=~/.electron-gyp npm install

package.json

{
...
  "scripts": {
    "start": "electron . --ignore-gpu-blacklist",
    "rebuild": "electron-rebuild node-pty"
  },
...
  "dependencies": {
    "electron": "^20.1.4",
    "node-pty": "^0.10.1",
    "xterm": "4.2.0"
  },
  "devDependencies": {
    "electron-rebuild": "^3.2.9"
  }
}

When rebuilding: npm rebuild will get this error

image

Will appreciate your help.

Thank you

me too!

i also meet this error

how to resolve this question?

me too!

你解决这个问题了吗?

me too!

你解决这个问题了吗?
使用 node-gyp 手动编译

me too!

你解决这个问题了吗?
使用 node-gyp 手动编译

你的那个binding.gyp的文件能给我看看吗?我这边参考一下,感谢

me too!

你解决这个问题了吗?
使用 node-gyp 手动编译

你的那个binding.gyp的文件能给我看看吗?我这边参考一下,感谢

You can set GYP_MSVS_VERSION: '2019' to system env variable to solve this problem.

me too!

你解决这个问题了吗?
使用 node-gyp 手动编译

你的那个binding.gyp的文件能给我看看吗?我这边参考一下,感谢

You can set GYP_MSVS_VERSION: '2019' to system env variable to solve this problem.

Thanks so much, it resolved my issue with win-dpapi.

me too!

你解决这个问题了吗?
使用 node-gyp 手动编译

你的那个binding.gyp的文件能给我看看吗?我这边参考一下,感谢

You can set GYP_MSVS_VERSION: '2019' to system env variable to solve this problem.

It works, it really works. After spending a whole day struggling with this problem, I finally solved it just by changing GYP_MSVS_VERSION from 2015 to 2019

I'm still having the same issue, setting GYP_MSVS_version didn't fix it