linnovate / mean

The MEAN stack uses Mongo, Express, Angular(6) and Node for simple and scalable fullstack js applications
http://mean.io
12.14k stars 3.45k forks source link

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

Closed PremkumarAgrawal closed 6 years ago

PremkumarAgrawal commented 7 years ago

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.

adrukh commented 7 years ago

@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.

PremkumarAgrawal commented 7 years ago

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.

adrukh commented 7 years ago

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?

PremkumarAgrawal commented 7 years ago

Yaa its npm install

adrukh commented 7 years ago

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?

PremkumarAgrawal commented 7 years ago

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

after running patch.exe --help

PremkumarAgrawal commented 7 years ago

@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...

adrukh commented 7 years ago

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.

PremkumarAgrawal commented 7 years ago

@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%

PremkumarAgrawal commented 7 years ago

@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..

adrukh commented 7 years ago

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

PremkumarAgrawal commented 7 years ago

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;

adrukh commented 7 years ago

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

PremkumarAgrawal commented 7 years ago

@adrukh LET ME TRY...

PremkumarAgrawal commented 7 years ago

Hey Thanks @adrukh patch issue is solved...

clowenhg commented 7 years ago

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.

adrukh commented 7 years ago

@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.

clowenhg commented 7 years ago

@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.

timelf123 commented 7 years ago

@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

aviadatsnyk commented 7 years ago

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.
adrukh commented 7 years ago

@liorkesos FYI ^^^ :)