I’m getting the following error when I try to open a dev container in VS 2022:
Failed to change target system to ‘[Dev Container]’: Unable to find ‘npm’. Please install it and try again.
This is the .devcontainer/devcontainer.json file:
{
"name": "CPP dev container",
"image": "link_to_image",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cmake-tools",
"llvm-vs-code-extensions.vscode-clangd",
"twxs.cmake",
"xaver.clang-format",
"ms-vscode.cpptools"
]
}
}
}
It works all fine in VS Code, but I also want it to work with Visual Studio.
These are the versions I’m using:
- Docker version 27.2.1-rd, build cc0ee3e
- Microsoft Visual Studio Professional 2022 (64-bit) – Preview, Version 17.13.0 Preview 2.0
I tried to include npm in the image and to make sure npm is installed on my Windows 11 laptop as well. The image is based on the Debian distro.