cancel
Showing results for 
Search instead for 
Did you mean: 

Vcpkg issue

lgacnik97
Associate III

I'm using a VS Code extension that most probably uses `vcpkg`. After installing this extension, each time I run VS Code I get the following error:

> Using vcpkg executable at "c:\Users\Luka\.vscode\extensions\ms-vscode.vscode-embedded-tools-0.7.0-win32-x64\assets\platform\win32-x64\vcpkg.exe".
> Using VCPKG_ROOT at "c:\Users\Luka\AppData\Roaming\Code\User\globalStorage\ms-vscode.vscode-embedded-tools\vcpkg\root".
> Activating environment at "c:\Repository\Code\STM32Cube\TestSTM32vscode\vcpkg-configuration.json".
> Version of vcpkg used to create VCPKG_ROOT: "2023-03-14-105f7f7e8a5ea10dfac9874ff9d1a6bacba5f454".
> Running vcpkg with arguments ["version"].
vcpkg package management program version 2023-03-14-105f7f7e8a5ea10dfac9874ff9d1a6bacba5f454
 
See LICENSE.txt for license information.
> Bundled version of vcpkg: "2023-03-14-105f7f7e8a5ea10dfac9874ff9d1a6bacba5f454".
> Running vcpkg with arguments ["activate","--project","c:\\Repository\\Code\\STM32Cube\\TestSTM32vscode","--json","C:\\Users\\Luka\\AppData\\Local\\Temp\\0b0bfd2e9086e9804700cf10fe331514"].
warning: vcpkg-artifacts is experimental and may change at any time.
Downloading vcpkg-artifacts bundle 2023-03-14...
Downloading github.com/microsoft/vcpkg-tool/releases/download/2023-03-14/vcpkg-ce.tgz
node:internal/modules/cjs/loader:1078
  throw err;
  ^
 
Error: Cannot find module 'C:\Users\Luka\AppData\Local\vcpkg\artifacts-2023-03-14\node_modules\'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
 
Node.js v18.16.0
> Failed with exit code "1".
> Failed to activate environment at "c:\Repository\Code\STM32Cube\TestSTM32vscode\vcpkg-configuration.json".

I have checked the files it cannot find and found out that the `artifacts-2023-03-14` is empty. I have tried several possible solution to this problem on Stack Overflow but didn't manage to change anything.

Possible solutions on SO: https //stackoverflow.com/questions/53545800/internal-modules-cjs-loader-js582-throw-err/54964538#54964538

Any idea or hint to possible solution is very much appreciated!

3 REPLIES 3
CsBe
Associate II

I just have the same problem and solved by extracting the vcpkg-ce.tgz file manually.

@CsBe​ Could you please share a few additional details? I have tried to resolve the issue based on your comment, but I couldn't. I tried to put the contents of the zip file I can download via the link mentioned in the vcpkg-configuration.json file and put it manually into the vcpkg\artifacts-2023-03-14 folder. However, when I try to again run the project import tool, I get the same error, and the artifact folder is empty again (seems to get overwritten with an empty folder).

bongumsa12
Associate III

Uninstall and fresh install your VS code extensions. Most commonly, the CMake extension. That should solve your issue.