skip to Main Content

I’ve been working on a project for a while and never had any enviroment issues.
Today I had to move the project to a different directory so I deleted it and cloned it somewhere else.
This is where the issue starts. I can’t run npm install, I get an error for node_modules/sharp even though there is no sharp in my package.json.
Full error log:

npm ERR! code 1
npm ERR! path E:snknode_modulessharp
npm ERR! command failed
npm ERR! command C:WINDOWSsystem32cmd.exe /d /s /c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm ERR! sharp: Using cached C:UsersMichalAppDataLocalnpm-cache_libvipslibvips-8.14.5-win32-x64.tar.br
npm ERR! sharp: Integrity check passed for win32-x64
npm ERR! sharp: Creating E:snknode_modulessharpbuildRelease
npm ERR! sharp: Copying DLLs from E:snknode_modulessharpvendor8.14.5win32-x64lib to E:snknode_modulessharpbuildRelease
npm ERR! 'prebuild-install' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 3.12.3 found at "C:Python312python.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 checking VS2022 (17.9.34728.123) found at:
npm ERR! gyp ERR! find VS "C:Program Files (x86)Microsoft Visual Studio2022BuildTools"
npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features"
npm ERR! gyp ERR! find VS - found VC++ toolset: v143
npm ERR! gyp ERR! find VS - missing any Windows SDK
npm ERR! gyp ERR! find VS checking VS2019 (16.11.34729.46) found at:
npm ERR! gyp ERR! find VS "C:Program Files (x86)Microsoft Visual Studio2019BuildTools"
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 - missing any Windows SDK
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 not looking for VS2015 as it is only supported up to Node.js 18
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:UsersMichalAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibfind-visualstudio.js:113:11)
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio (C:UsersMichalAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibfind-visualstudio.js:69:17)
npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm ERR! gyp ERR! stack at async createBuildDir (C:UsersMichalAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibconfigure.js:69:26)
npm ERR! gyp ERR! stack at async run (C:UsersMichalAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js:81:18)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "D:\Program Files\Nodejs\node.exe" "C:\Users\Michal\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd E:snknode_modulessharp
npm ERR! gyp ERR! node -v v21.7.3
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: C:UsersMichalAppDataLocalnpm-cache_logs2024-04-12T01_47_32_159Z-debug-0.log

I tried using npm i -g windows-build-tools but that throws another error, solving that one caused further issues so I got out of that rabbit hole

2

Answers


  1. Chosen as BEST ANSWER

    The issue was the fact that I used fsutil.exe file setCaseSensitiveInfo enable on the project directory before cloning. I had to change the paths manually instead


  2. Did you install workload-vctools via choco install python visualstudio2022-workload-vctools -y?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search