Use our Snyk CLI tool to find and fix known vulnerabilities in your dependencies, both ad hoc and as part of your CI (Build) system.
The Snyk CLI requires you to authenticate with your account before using it. See Authenticate the CLI with your account.
Install the Snyk CLI using one of these options:
Install our Snyk CLI tool using npm.
Ensure you’ve installed the latest version of npm on your local environment, using Node version 10 or later (see What version of Node is required for Snyk?).
To run Snyk on Alpine Linux, first install libstdc++. See this doc for more help.
Run these commands to install it for local use:
npm install -g snyk
Once installed, you need to authenticate with your Snyk account:
To test your installation change directory into a folder containing a supported package manifest file (package.json, pom.xml, composer.lock, etc.) and run:
cd /my/project/snyk test
Alternatively, you can perform a quick test on a public npm package, for instance:
snyk test ionic
As you can see, Snyk found and reported several vulnerabilities in the package. For each issue found, Snyk provides the severity of the issue, a link to a detailed description, the path through which the vulnerable module got into your system, and guidance on how to fix the problem.
You can download and use Snyk's prebuilt binaries already containing npm, the Snyk CLI and other necessary components. To download the prebuilt binary, visit the Releases tab in the CLI repository page in GitHub:
You can use a Snyk created Docker container already containing npm, the Snyk CLI and other necessary components. Follow the detailed instructions here https://hub.docker.com/r/snyk/snyk-cli
From MAC OSx and Linux environments, you can use Homebrew to install our Snyk CLI tool. The repository for installation is stored in our GitHub.
Supported for MAC OSx and Linux environments only.
Ensure Homebrew has already been installed:
brew tap snyk/tap
Install Snyk as follows:
brew install snyk
From Windows environments, you can use Scoop to install our Snyk CLI tool. The repository for installation is stored in our GitHub.
Supported for Windows environments only.
Ensure Scoop has already been installed:
scoop bucket add snyk https://github.com/snyk/scoop-snyk
scoop install snyk