
npm install stremio-addon-sdk node ./addon.js MeansBefore Installing the Stremio Addon SDKCreate and Run addon.jsTroubleshooting npm install stremio-addon-sdk node ./addon.jsAdd Convenient npm ScriptsFAQConclusionBuilding a Stremio add-on starts with two simple tasks: install the Stremio Addon SDK and run your JavaScript server. The command npm install stremio-addon-sdk node ./addon.js is often written as if it were one command, but it actually combines two separate commands. Understanding the difference helps you install dependencies correctly, start your add-on reliably, and troubleshoot common errors.
What npm install stremio-addon-sdk node ./addon.js Means
The correct workflow uses two commands:
``bash npm install stremio-addon-sdk node ./addon.js ``
The first command uses npm, Node.js’s package manager, to download the stremio-addon-sdk package into your project. It normally adds the package to package.json and installs it in a local node_modules directory.
The second command starts your add-on’s JavaScript file with Node.js. The ./ means “in the current directory,” so node ./addon.js expects a file named addon.js in the folder where you run the command.
Do not usually enter this as one line:
``bash npm install stremio-addon-sdk node ./addon.js ``
npm may interpret the extra words as package names or arguments rather than as a separate command to run your server.
To run both commands on one line, use an appropriate shell operator:
``bash npm install stremio-addon-sdk && node ./addon.js ``
The && starts the second command only if installation succeeds.
Before Installing the Stremio Addon SDK
Install Node.js from the official Node.js website before using npm. The LTS release is generally the best choice for beginners because it receives long-term maintenance and tends to be more stable than experimental versions.
Confirm that Node.js and npm are available:
``bash node --version npm --version ``
Next, create a dedicated project directory:
``bash mkdir my-stremio-addon cd my-stremio-addon npm init -y ``
The npm init -y command creates a basic package.json file. This file records your project name, version, scripts, and dependencies.
Now install the SDK:
``bash npm install stremio-addon-sdk ``
If npm reports permission errors, avoid using administrator privileges as your first solution. Check that you own the project directory, use a Node version manager, or reinstall Node.js using a standard user setup.
Create and Run addon.js
Create a file named addon.js in the project directory. A minimal add-on can look like this:
```js const { addonBuilder } = require("stremio-addon-sdk");
const builder = new addonBuilder({ id: "com.example.myaddon", version: "1.0.0", name: "My Stremio Add-on", description: "A basic example add-on", resources: ["stream"], types: ["movie", "series"], catalogs: [] });
builder.defineStreamHandler(async (args) => { return { streams: [] }; });
const port = process.env.PORT || 7000;
builder.getInterface().listen(port, () => { console.log(Add-on running at http://localhost:${port}/manifest.json); }); ```
Start it with:
``bash node ./addon.js ``
If it works, the terminal should display a local address. Open the manifest URL in a browser:
``text http://localhost:7000/manifest.json ``
The manifest describes your add-on to Stremio. An empty streams array is expected in this basic example; a real add-on must implement logic that returns valid stream URLs for supported content.
Keep the terminal window open while testing. Closing it stops the local server.
Troubleshooting npm install stremio-addon-sdk node ./addon.js
If you see Cannot find module 'stremio-addon-sdk', run the installation command from the same directory as addon.js:
``bash npm install stremio-addon-sdk ``
Also confirm that a node_modules folder and package-lock.json file were created. If the problem continues, remove the local installation and reinstall:
``bash rm -rf node_modules package-lock.json npm install ``
On Windows PowerShell, use:
``powershell Remove-Item -Recurse -Force node_modules Remove-Item package-lock.json npm install ``
A Cannot find module './addon.js' error means Node cannot locate your script. Check the filename, capitalization, and current directory:
``bash dir ``
or:
``bash ls ``
Port errors such as EADDRINUSE mean another application is already using port 7000. Stop the other process or choose another port:
``bash const port = process.env.PORT || 7001; ``
If Stremio cannot connect to localhost, remember that localhost is normally accessible only from the same device. A remote Stremio device cannot automatically reach a server running on your computer. For testing across devices, you may need a reachable local network address, secure hosting, or a temporary development tunnel.
Add Convenient npm Scripts
Instead of typing node ./addon.js every time, add a start script to package.json:
``json { "scripts": { "start": "node ./addon.js" } } ``
You can then start the add-on with:
``bash npm start ``
A development script can also use Node’s watch mode on supported Node.js versions:
``json { "scripts": { "start": "node ./addon.js", "dev": "node --watch ./addon.js" } } ``
Run it with:
``bash npm run dev ``
Watch mode restarts the process when you save changes. This makes it easier to test manifest updates and handler code without manually stopping and restarting the server.
FAQ
Is npm install stremio-addon-sdk node ./addon.js a valid command?
Usually, no. Use npm install stremio-addon-sdk to install the SDK, then run node ./addon.js separately. Use && between them if you need a single command line.
Where should addon.js be located?
Place addon.js in your project’s main directory, normally alongside package.json. Run the Node command from that directory, or provide the correct relative path to the file.
Can I use the add-on on a different device?
A server running on localhost is normally available only on the computer running it. To use the add-on on another device, host it on a reachable network address or deploy it to a suitable server with a public URL.
Conclusion
The key to using npm install stremio-addon-sdk node ./addon.js correctly is separating installation from execution. Run npm install stremio-addon-sdk once to add the SDK, then use node ./addon.js whenever you want to start your Stremio add-on. With a valid project structure, manifest, and running server, you have a practical foundation for developing and testing custom Stremio functionality.