I´m trying to install the npm module scrypt.
I know scrypt requires node-gyp, i installed it globally (several times). Also I know node-gyp requires python 2.7 and MS Build Tools. I installed the latest python 2.7 build and i installed MS Build Tools. I also tried with VS Community Edition 2017. I tried to repair and reinstall both.
I also installed npm package windows-build-tools (several times) globally successful.
But wenn i try npm i scrypt
i got the following errors:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v141 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install v141 bu ild tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [c:\project\node_modules\scrypt\build\copied_files.vcxproj] C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v141 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install v141 bu ild tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [c:\project\node_modules\scrypt\build\scrypt_wrapper.vcxproj]
Any tips or suggestions?
After a few more hours, i found out there was an old installation of visual studio 2015. I had to uninstall it first. I have no clue, why not the newest instance of build tools was used.
After this, and downgrading Node to v8, scrypt could be installed and compiled again.
I guess what fixed it for smonkey, who uninstalled an older installation of Visual Studio, was that that uninstall process also removed that old MSBuild path from %PATH%.
Because for me, just removing that old MSBuild.exe from the path fixed it.
node-gyp
does not need MSBuild on the path, but it gets tripped up if there is one on the path that's too old for the build target.So either delete your MSBuild path, or make sure it points to the latest version. Unless of course you wanted to uninstall Visual Studio anyway, but that is not an option for some.