npm for 9Router: packages, versions, and paths
Understand how npm installs the 9Router package, check Node and executable paths, inspect package provenance, and keep upgrades separate from router data.
npm is the package manager used to install 9Router’s published Node.js package. It downloads software and makes its command available; it does not supply model access, provider credits, or a running server by itself. If you already have Node and want the exact installation sequence, use npm install for 9Router.
Understand the three names
Node.js runs the JavaScript application. npm manages its packages. 9router is the published package and command you intend to install. Check them separately:
node --version
npm --version
npm view 9router name version repository.url engines
The last command reads registry metadata without installing the package. Compare the repository field with the upstream project. Do not choose a similarly named package because its search description sounds right. Package metadata helps establish identity, but it is not a security audit of the package contents.
Global and local installations serve different purposes
A global installation makes a command available through npm’s configured executable location. A local installation writes dependencies into the current project’s node_modules and updates its package metadata where appropriate. Running a bare npm install inside the 9Router source repository installs that project’s dependencies, not the globally published CLI.
| Command | Meaning |
|---|---|
npm view 9router version | Read the currently published version |
npm list -g 9router --depth=0 | Inspect the installed global package |
npm prefix -g | Find the global installation prefix |
npm install -g 9router | Install the published CLI globally |
npm install inside a checkout | Install that checkout’s dependencies |
Do not mix these workflows when diagnosing a problem. A terminal might run a global executable even while your current directory contains a newer source checkout.
Why can npm see the package while the shell cannot?
Package installation and command lookup are separate. Your shell must include the executable location in PATH. Node version managers can also give each runtime version its own global packages. After switching Node versions, the old installation may still exist but no longer be the one your shell uses.
On macOS or Linux, inspect command resolution with command -v node, command -v npm, and command -v 9router. On Windows, use where.exe node, where.exe npm, and where.exe 9router. Compare those paths with the runtime and prefix you intended to use. Reopen the terminal if an installer updated the environment after the shell started.
Handle permissions at the installation layer
For EACCES, npm documents using a Node version manager or a writable global directory. Avoid responding to every permission error by running an unreviewed install as administrator. First identify which directory is unwritable and why the current npm configuration uses it.
A package download error, registry timeout, permission error, and server port conflict require different repairs. Save the first meaningful error from npm instead of only the final “command failed” line. The npm install guide provides a practical symptom table.
Keep package updates separate from your data
The package directory contains application files. The router’s persistent data contains provider connections and settings. Confirm the data path for your installed version and back it up before upgrading. Do not assume deleting a global package backs up its data or that reinstalling it resets every setting.
Record the currently installed version before an update. Afterward, confirm the executable path, start the server, and repeat the same model-list and small-request checks. If you use a source checkout, record its commit separately. That makes a later issue report more useful than saying only “latest.”
References for this guide
Steps were checked against the linked documentation and source. Provider access and model availability depend on your account. We do not claim a completed live model test unless explicitly stated.