linnovate/mean

Snyk couldn't patch the specified vulnerabilities because GNU's patch is not available.

PremkumarAgrawal opened this issue ยท 21 comments

Hello everyone
I am trying to initialize new MEAN project & facing this issue on PC & laptop both.

Snyk couldn't patch the specified vulnerabilities because GNU's patch is not available. Please install 'patch' and try again.

@PremkumarAgrawal please install binaries from https://git-scm.com/download/win, they include the required GNU patch.

I'm on the Snyk team and we are pushing for smoother windows support in the next releases!
See https://github.com/Snyk/snyk/issues/48#issuecomment-256260149 for more details.

Hey @adrukh thanks for responding..
I hav already install Git Bash & i have also set the environment variables also for it still i am facing the same issue, how i can overcome it.

Perhaps patch.exe is not in your %PATH%?

What command are you running when you see this error message? Is it npm install or something else?

Yaa its npm install

And if you just run patch.exe --help at the same prompt where you run npm install, do you get the help info or Bad command or filename?

I am getting
'patch.exe' is not recognized as an internal or external command, operable program or batch file.

after running patch.exe --help

@adrukh I got some links which are suggesting me to download & install patch.exe from this link http://gnuwin32.sourceforge.net/packages/patch.htm

What should I do...

IMPORTANT please refrain from using the gnuwin32.sourceforge... link as it points to an executable that does not comply with proper cli use.

Use https://git-scm.com/download/win instead.

As for the output you've shared, patch.exe is not in your %PATH%. Please add the proper folder where the binaries are installed and run npm install only when patch.exe --help works for you.

@adrukh Can you please tel me where I can find patch.exe after installing GIT from this given link https://git-scm.com/download/win. So that i can add patch.exe to my %PATH%

@adrukh I got patch.exe at this location C:\Program Files\Git\usr\bin\patch.exe after installing GIT, I set the PATH variable also & execute the command patch.exe --help found the same

'patch.exe' is not recognized as an internal or external command, operable program or batch file.

Did i used the proper patch.exe or I should use any one else..

The location is ok. Can you show the output of echo %PATH% from your prompt?

Yaa Here t is,

C:\ProgramData\Oracle\Java\javapath;C:\oraclexe\app\oracle\product\10.2.0\server \bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32 \WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\P rogram Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x 86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Java\jdk1.7.0_02\bin;C:\Program F iles (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL S erver\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\M anagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;F:\An droid Studio\android-sdk\tools\ant\bin;F:\Android Studio\tools;C:\Program Files\ nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\bin;C:\Program Files\Git\u sr\bin\patch.exe;.;C:\Program Files\Java\jdk1.7.0_51\bin;.;C:\Users\Premkumar\Ap pData\Roaming\npm;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files\ Git\cmd;C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin\patch.exe;

Change the added part from C:\Program Files\Git\usr\bin\patch.exe; to C:\Program Files\Git\usr\bin; and you're done!

@adrukh LET ME TRY...

Hey Thanks @adrukh patch issue is solved...

Labeling this Documentation because, if I'm not mistaken, this is a known thing and we just don't have this info readily available yet.

Or @adrukh is there an ETA on the improved windows support? Don't want to spend time writing up documentation if this will all just sort of work next week.

@clowenhg thanks for documenting!

The improvement to bundle the patch.exe binary with snyk is on our roadmap but doesn't have a definitive release right now.

@adrukh @rjVapes I've assigned you guys just to review that the relevant info is here (I don't know if there would be something missing). I'll write up the summary in the Readme.

@clowenhg If it's helpful, I remember recording a screencast/gif of this process (installing patch and adding to path) but I can't find the link! It may be in the gitter chat?

I thought it was in the snyk issue queue itself but don't see it https://github.com/Snyk/snyk/issues/45

Hey!

The improved windows support is here! Currently, it's in beta and will be released soon. if you can't wait - we'd love for you to try it right now and make sure we got it right for you. If you encounter any issues - please report them either here or at https://github.com/Snyk/snyk/issues/48

To do this:

  1. npm install -g snyk@dev
  2. Try snyk test, snyk protect and snyk wizard to make sure you get the usual excellent snyk experience.

@liorkesos FYI ^^^ :)