conda-forge / nodejs-feedstock

A conda-smithy repository for nodejs.
BSD 3-Clause "New" or "Revised" License
5 stars 37 forks source link

Windows installer vs conda-forge::nodejs C compiler #374

Closed rsxdalv closed 1 month ago

rsxdalv commented 1 month ago

Comment:

I know for a fact that the Windows installer also sets up build tools; but I am unable to verify if conda-forge distribution contains it. I would guess not (and I have seen installs fail due to node-gyp).

So I wonder what is the workaround? Doing npm install --global windows-build-tools?

xhochy commented 1 month ago

In the conda world, you would install the c-compiler package.

rsxdalv commented 1 month ago

Thank you for the fast response! I manually uninstalled build tools and will test it and try to post my findings here.

rsxdalv commented 1 month ago

Ah, it failed:

(C:\Users\admin\Desktop\one-click-installers-tts-main\installer_files\env) C:\Users\admin\Desktop\one-click-installers-tts-main>conda install conda-forge::c-compiler
Collecting package metadata (current_repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. <==
  current version: 23.1.0
  latest version: 24.9.0

Please update conda by running

    $ conda update -n base -c defaults conda

Or to minimize the number of packages updated during conda update use

     conda install conda=24.9.0

## Package Plan ##

  environment location: C:\Users\admin\Desktop\one-click-installers-tts-main\installer_files\env

  added / updated specs:
    - conda-forge::c-compiler

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    c-compiler-1.8.0           |       hcfcfb64_0           6 KB  conda-forge
    vs2019_win-64-19.29.30154  |       h96f319f_5          11 KB
    vswhere-2.8.4              |       haa95532_0         210 KB
    ------------------------------------------------------------
                                           Total:         227 KB

The following NEW packages will be INSTALLED:

  c-compiler         conda-forge/win-64::c-compiler-1.8.0-hcfcfb64_0
  vs2019_win-64      pkgs/main/win-64::vs2019_win-64-19.29.30154-h96f319f_5
  vswhere            pkgs/main/win-64::vswhere-2.8.4-haa95532_0

Proceed ([y]/n)? y

Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

C:\Users\admin\Desktop\one-click-installers-tts-main>SET DISTUTILS_USE_SDK=1

C:\Users\admin\Desktop\one-click-installers-tts-main>SET MSSdk=1

C:\Users\admin\Desktop\one-click-installers-tts-main>SET "VS_VERSION=16.5"

C:\Users\admin\Desktop\one-click-installers-tts-main>SET "VS_MAJOR=16"

C:\Users\admin\Desktop\one-click-installers-tts-main>SET "VS_YEAR=2019"

C:\Users\admin\Desktop\one-click-installers-tts-main>set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"

C:\Users\admin\Desktop\one-click-installers-tts-main>set "MSYS2_ENV_CONV_EXCL=CL"

C:\Users\admin\Desktop\one-click-installers-tts-main>set "PY_VCRUNTIME_REDIST=\bin\vcruntime140.dll"

C:\Users\admin\Desktop\one-click-installers-tts-main>set "CXX=cl.exe"

C:\Users\admin\Desktop\one-click-installers-tts-main>set "CC=cl.exe"

C:\Users\admin\Desktop\one-click-installers-tts-main>set "VSINSTALLDIR="

C:\Users\admin\Desktop\one-click-installers-tts-main>for /F "usebackq tokens=*" %i in (`vswhere.exe -nologo -products * -version [16.0,17.0] -property installationPath`) do (set "VSINSTALLDIR=%i\" )

C:\Users\admin\Desktop\one-click-installers-tts-main>if not exist "" (for /F "usebackq tokens=*" %i in (`vswhere.exe -nologo -products * -requires Microsoft.VisualStudio.Component.VC.v142.x86.x64 -property installationPath`) do (set "VSINSTALLDIR=%i\" ) )

C:\Users\admin\Desktop\one-click-installers-tts-main>if not exist "" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\" )

C:\Users\admin\Desktop\one-click-installers-tts-main>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\" )

C:\Users\admin\Desktop\one-click-installers-tts-main>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\" )

C:\Users\admin\Desktop\one-click-installers-tts-main>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\" )

C:\Users\admin\Desktop\one-click-installers-tts-main>IF NOT "" == "" (
set "INCLUDE=;"
 set "LIB=;"
 set "CMAKE_PREFIX_PATH=;"
)

C:\Users\admin\Desktop\one-click-installers-tts-main>call :GetWin10SdkDir

C:\Users\admin\Desktop\one-click-installers-tts-main>call :GetWin10SdkDirHelper HKLM\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\Users\admin\Desktop\one-click-installers-tts-main>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\Users\admin\Desktop\one-click-installers-tts-main>if errorlevel 1 call :GetWin10SdkDirHelper HKLM\SOFTWARE  1>nul 2>&1

C:\Users\admin\Desktop\one-click-installers-tts-main>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE  1>nul 2>&1

C:\Users\admin\Desktop\one-click-installers-tts-main>if errorlevel 1 exit /B 1

C:\Users\admin\Desktop\one-click-installers-tts-main>exit /B 0

C:\Users\admin\Desktop\one-click-installers-tts-main>for /F %i in ('dir /ON /B "\include"') DO (if NOT "%~i" == "wdf" (for /F "tokens=3 delims=." %a in ("%~i") do (if %a LSS 22621 (SET WindowsSDKVer=%~i ) ) ) )
File Not Found

C:\Users\admin\Desktop\one-click-installers-tts-main>if errorlevel 1 (echo "Didn't find any windows 10 SDK. I'm not sure if things will work, but let's try..." )  else (echo Windows SDK version found as: "" )
Windows SDK version found as: ""

C:\Users\admin\Desktop\one-click-installers-tts-main>IF "win-64" == "win-64" (
set "CMAKE_GEN=Visual Studio 16 2019 Win64"
 set "BITS=64"
)  else (
set "CMAKE_GEN=Visual Studio 16 2019"
 set "BITS=32"
)

C:\Users\admin\Desktop\one-click-installers-tts-main>pushd C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
The system cannot find the path specified.

C:\Users\admin\Desktop\one-click-installers-tts-main>set VSCMD_DEBUG=1

C:\Users\admin\Desktop\one-click-installers-tts-main>CALL "VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.2
The system cannot find the path specified.

C:\Users\admin\Desktop\one-click-installers-tts-main>popd

C:\Users\admin\Desktop\one-click-installers-tts-main>IF "" == "" SET "CMAKE_GENERATOR=Visual Studio 16 2019 Win64"

C:\Users\admin\Desktop\one-click-installers-tts-main>call :GetWin10SdkDirHelper HKLM\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\Users\admin\Desktop\one-click-installers-tts-main>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\Users\admin\Desktop\one-click-installers-tts-main>if errorlevel 1 call :GetWin10SdkDirHelper HKLM\SOFTWARE  1>nul 2>&1

C:\Users\admin\Desktop\one-click-installers-tts-main>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE  1>nul 2>&1

C:\Users\admin\Desktop\one-click-installers-tts-main>if errorlevel 1 exit /B 1

C:\Users\admin\Desktop\one-click-installers-tts-main>exit /B 0
npm error code 1
npm error path C:\Users\admin\Desktop\one-click-installers-tts-main\test-node\node_modules\iconv
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@10.2.0
npm error gyp info using node@22.9.0 | win32 | x64
npm error gyp info find Python using Python version 3.9.1 found at "C:\Python39\python.exe"
npm error gyp http GET https://nodejs.org/download/release/v22.9.0/node-v22.9.0-headers.tar.gz
npm error gyp http 200 https://nodejs.org/download/release/v22.9.0/node-v22.9.0-headers.tar.gz
npm error gyp http GET https://nodejs.org/download/release/v22.9.0/SHASUMS256.txt
npm error gyp http GET https://nodejs.org/download/release/v22.9.0/win-x64/node.lib
npm error gyp http 200 https://nodejs.org/download/release/v22.9.0/SHASUMS256.txt
npm error gyp http 200 https://nodejs.org/download/release/v22.9.0/win-x64/node.lib
npm error gyp ERR! find VS
npm error gyp ERR! find VS msvs_version not set from command line or npm config
npm error gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm error gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details.
npm error gyp ERR! find VS
npm error gyp ERR! find VS Failure details: undefined
npm error gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details.
npm error gyp ERR! find VS
npm error gyp ERR! find VS Failure details: undefined
npm error gyp ERR! find VS not looking for VS2017 as it is only supported up to Node.js 21
npm error gyp ERR! find VS not looking for VS2017 as it is only supported up to Node.js 21
npm error gyp ERR! find VS not looking for VS2017 as it is only supported up to Node.js 21
npm error gyp ERR! find VS not looking for VS2015 as it is only supported up to Node.js 18
npm error gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm error gyp ERR! find VS
npm error gyp ERR! find VS **************************************************************
npm error gyp ERR! find VS You need to install the latest version of Visual Studio
npm error gyp ERR! find VS including the "Desktop development with C++" workload.
npm error gyp ERR! find VS For more information consult the documentation at:
npm error gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm error gyp ERR! find VS **************************************************************
npm error gyp ERR! find VS
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm error gyp ERR! stack at VisualStudioFinder.fail (C:\Users\admin\Desktop\one-click-installers-tts-main\installer_files\env\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:118:11)
npm error gyp ERR! stack at VisualStudioFinder.findVisualStudio (C:\Users\admin\Desktop\one-click-installers-tts-main\installer_files\env\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:17)
npm error gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
npm error gyp ERR! stack at async createBuildDir (C:\Users\admin\Desktop\one-click-installers-tts-main\installer_files\env\node_modules\npm\node_modules\node-gyp\lib\configure.js:112:18)
npm error gyp ERR! stack at async run (C:\Users\admin\Desktop\one-click-installers-tts-main\installer_files\env\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js:81:18)
npm error gyp ERR! System Windows_NT 10.0.19045
npm error gyp ERR! command "C:\\Users\\admin\\Desktop\\one-click-installers-tts-main\\installer_files\\env\\node.exe" "C:\\Users\\admin\\Desktop\\one-click-installers-tts-main\\installer_files\\env\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm error gyp ERR! cwd C:\Users\admin\Desktop\one-click-installers-tts-main\test-node\node_modules\iconv
npm error gyp ERR! node -v v22.9.0
npm error gyp ERR! node-gyp -v v10.2.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: C:\Users\admin\AppData\Local\npm-cache\_logs\2024-10-01T12_46_18_595Z-debug-0.log
xhochy commented 1 month ago

Yes, you need to install the VS Build tools directly from MS. We are not allowed to ship them.

rsxdalv commented 1 month ago

Yes, you need to install the VS Build tools directly from MS. We are not allowed to ship them.

Thank you for clarifying that. In a way it is strange that npm install --global windows-build-tools and Node.js windows installer do it, and I see this as a growing issue as more users switch to nvm and conda rather than a simple Node.js install, while node-gyp guys see it as a resolved problem. I will create an issue about this on node-gyp or windows-build-tools