- 1 year ago
node-sass installation cannot find installed msvs_version
When installing node-sass
, you may encounter the error message "Cannot find installed msvs_version". This error occurs when the installation process cannot detect the appropriate Microsoft Visual Studio version on your system. node-sass
requires a compatible build toolchain to be present on your machine for compilation.
Here's how you can resolve this issue:
Install Microsoft Build Tools:
Download and install the Microsoft Build Tools for your specific Visual Studio version. You can find the Build Tools download link here: https://visualstudio.microsoft.com/visual-cpp-build-tools/. Make sure you download the version that matches your Visual Studio or MSVC requirements.
After installing the Build Tools, restart your computer to ensure that the changes take effect.
Set the correct msvs_version:
Open a Command Prompt or PowerShell with administrator privileges.
Run the following command to set the appropriate msvs_version based on the installed Build Tools version:
bashnpm config set msvs_version <your_msvs_version>
Replace
<your_msvs_version>
with the specific version number of the Build Tools you installed. For example, if you installed Visual Studio Build Tools 2019, the version number would be "2019".Install
node-sass
again:Now, try installing
node-sass
again using npm:bashnpm install node-sass
The installation should now work without the "Cannot find installed msvs_version" error.
Keep in mind that you might also need to install Python and add it to your system's PATH if it's not already installed, as node-sass
requires Python during the installation process.
If you encounter any further issues, double-check that you have the correct version of Visual Studio Build Tools installed and that your system environment variables are properly configured for node.js development.