Reputation: 181
I was trying to install sharp module, which requires: c++ compiler - I downloaded Visual Studio 2017 and visual c++ build tools node-gyp - It was installed successfully
But running 'npm install -g sharp' I got many errors
E:\VS\MSBuild\15.0\Bin\MSBuild.exe
failed
with exit code: 1node-gyp rebuild
npm ERR! Exit status 1If it matters - I'm a Windows user
Upvotes: 9
Views: 15431
Reputation: 71
When you install the vs_BuildTools.exe by using this command
npm install --global windows-build-tools
if you encounter some errors, try installing manually.
Then don't forget to add the msbuild.exe to your system path.
i.e. C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\amd64
when this is not in your path, the system tries to use another msbuild.exe from your .NET installation.
I fixed mine like that.
Upvotes: 1
Reputation: 6060
It sounds like build tools are not installed, You have to install the build tools for Windows
npm install --global windows-build-tools
Upvotes: 4
Reputation: 597
Just came across a similar problem and after a lot of searches online, it seems like a problem with the latest node version that automatically integrate and use v8 engine, that older dependencies doesn't support. it seems like an ms-build problem, but that's probably not the real issue. I have tried the following without success:
%APPDATA%\npm-cache\_libvips
and installing from herenpm install --global windows-build-tool
This is how I solved it:
npm install npm@latest -g
npm install --ignore-scripts
node-sass
you'd might want to also run this: npm rebuild node-sass --force --ignore-scripts
Upvotes: 2