prebuild-install failed with error

1,447 阅读1分钟
yarn install v1.22.10
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers 
in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/5] Resolving packages...
success Already up-to-date.
$ electron-builder install-app-deps
  • electron-builder  version=22.9.1
  • rebuilding native dependencies  dependencies=win-version-info@3.1.1 platform=win32 arch=x64
  • install prebuilt binary  name=win-version-info version=3.1.1 platform=win32 arch=x64
  • build native dependency from sources  name=win-version-info
                                          version=3.1.1
                                          platform=win32
                                          arch=x64
                                          reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
                                          error=prebuild-install info begin Prebuild-install version 5.3.6
    prebuild-install info looking for cached prebuild @ C:\Users\XXXppData\Roaming\npm-cache\_prebuilds\e2a3b7-win-version-info-v3.1.1-electron-v85-win32-x64.tar.gz

  • rebuilding native dependency  name=win-version-info version=3.1.1
  ⨯ cannot execute  cause=exit status 1
                    out=yarn run v1.22.10
    info If you think this is a bug, please open a bug report with the information provided in "D:\\dev\\duguanjia-front\\node_modules\\win-version-info\\yarn-error.log".
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

                    errorOut=error An unexpected error occurred: "Cannot create property 'https' on string 'https://registry.yarnpkg.com'".     

                    command='D:\tools\node\node.exe' 'C:\Users\XX\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js' run install       
                    workingDir=D:\dev\duguanjia-front\node_modules\win-version-info
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
# step 1
npm install --global --production windows-build-tools
# step 2
yarn