---
title: "corestack_node_packages_update"
url: https://docs.corefinity.com/mcp/tools/corestack_node_packages_update
type: tool
last_updated: 2026-11-13
feature: node-runtime
related:
  - https://docs.corefinity.com/api/reference/runtime/update-node-runtime.md
  - https://docs.corefinity.com/guides/sites/software-and-services/node-js.md
---
# corestack_node_packages_update

**Change Node.js global packages.** Set a row's global npm packages, at its `revision`: send the full list; new or changed lines are pinned to the version they resolve to now, kept lines keep their pins, and `update` re-resolves the named ones. Public npm registry only. Scope: write. Also needs exec when it turns on a Node package's install scripts. Long-running: answers with a task.

- Scope: `write`
- Also needs `exec` when exec
- Runs as a task: yes

## When to use it

Set a row's global npm packages at its `revision`. Send the full list: a package left out is removed, a new line or a changed selector is pinned to the version it resolves to now, kept lines keep their pins, and `update` re-resolves the named ones. Public npm registry only. Turning install scripts on for a package that does not run them now also needs exec. A refused install keeps the previous set and the task ends `work_failed` with npm's message.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `revision` (integer, ≥ 0, required)
- `packages` (array of `{name, selector?, scripts?}`, up to 20, required)
- `update` (array of package names)

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "packages": {
      "description": "The full list; a package left out is removed.",
      "items": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "The npm package name, e.g. sass or @angular/cli.",
            "maxLength": 214,
            "minLength": 1,
            "type": "string"
          },
          "scripts": {
            "description": "Run its install scripts (needs exec when it turns them on).",
            "type": "boolean"
          },
          "selector": {
            "description": "A version, range or dist-tag (default latest).",
            "maxLength": 255,
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "maxItems": 20,
      "type": "array"
    },
    "revision": {
      "description": "From corestack_node_runtime_get; stale when the row changed since.",
      "minimum": 0,
      "type": "integer"
    },
    "site_id": {
      "description": "The row: the site or one of its environments.",
      "minimum": 1,
      "type": "integer"
    },
    "update": {
      "description": "Names of listed packages to re-resolve now.",
      "items": {
        "maxLength": 214,
        "minLength": 1,
        "type": "string"
      },
      "maxItems": 20,
      "type": "array"
    }
  },
  "required": [
    "site_id",
    "revision",
    "packages"
  ],
  "type": "object"
}
```

## Refusals

- `switched_off`: commands are switched off; nothing can install a changed set.
- `package_spec_invalid`, `package_duplicate`, `package_limit`, `package_unresolvable`: fix the list.
- `scripts_memory` (`panel_status` 422): the list turns install scripts on for a package that has an install script, and the
  environment's command line has less memory than install scripts need (`details`: `packages`, `cli_memory_mib`,
  `min_cli_memory_mib`). Nothing is saved. Send the list with `scripts` off for those packages, or change the
  environment to a larger size first. A package that already runs its scripts there is never refused. For example,
  `{"name": "bcrypt", "scripts": true}` on a 224 MiB command line: "bcrypt runs an install script, and this environment's
  command line has 224 MiB of memory; install scripts need at least 512 MiB. Turn install scripts off for bcrypt, or
  choose a larger size."
- `registry_unavailable`: the npm registry did not answer; try again later.
- `stale`, `runtime_locked`, `busy`: as corestack_node_version_change.
- `managed_elsewhere` (message: "This site is managed by another control panel"): another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_node_packages_update",
  "arguments": {
    "site_id": 4211,
    "revision": 7,
    "packages": [
      {"name": "sass", "selector": "latest"},
      {"name": "sharp", "selector": "0.34", "scripts": true}
    ]
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_node_packages_update with site_id 4211, revision 7, packages [{"name":"sass","selector":"latest"},{"name":"sharp","selector":"0.34","scripts":true}]. (Change Node.js global packages.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [PUT /api/corestack/sites/{site}/node-runtime](https://docs.corefinity.com/api/reference/runtime/update-node-runtime.md)
- Guide: [Node.js configuration](https://docs.corefinity.com/guides/sites/software-and-services/node-js.md)
