> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/developer-tools/snyk-cli/install-the-snyk-cli/install-or-upgrade-to-version-of-node.js-required-for-snyk-cli.md).

# Install or upgrade to version of Node.js required for Snyk CLI

How to install or upgrade to the Node.js version required for the Snyk CLI

Node.js v12 or higher is required for Snyk CLI version 1.853.0 and higher. Snyk recommends running as recent a version of Node.js and npm as possible to ensure full compatibility.

### How to upgrade Node.js

Node.js comes with npm pre-installed, but the manager is updated more frequently than Node.js.

To update Node.js, you need need the npm [n module](https://www.npmjs.com/package/n).

Run this code to clear the npm cache, install `n`, and install the latest stable version of Node.js:

```
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
```

To install the latest release, use `n latest`. Alternatively, you can run `n #.#.#` to get a specific Node.js version.

Follow these steps to upgrade Node.js:

1. Run `npm-v` to see which version you have.
2. Then run`npm install npm@latest -g` to install the newest npm update.
3. Run `npm -v` again to make sure npm updated correctly.

### How to upgrade npm

To upgrade npm, run the following:

```
npm install -g npm
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snyk.io/developer-tools/snyk-cli/install-the-snyk-cli/install-or-upgrade-to-version-of-node.js-required-for-snyk-cli.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
