THE ORB
Starting the studio

Error: Cannot find module '<name>'

A script is missing pieces it needs to run — usually it was downloaded from GitHub without its extras.

groupsThat script does nothingpersonYou can fix this

Do this first

Get a proper release from the seller rather than a source download.

bug_reportPaste your whole console instead

What it means

A JavaScript resource asked for a package that is not there. FXServer runs Node for server_scripts ending in .js, and it resolves modules from the resource's own node_modules.

What causes it

Ordered by how often it is the answer.

  1. 1

    node_modules was never installed

    The resource shipped its package.json and not its dependencies. Published resources usually bundle them; a resource from GitHub usually does not.

  2. 2

    It is a Node built-in that FXServer does not expose

    FXServer's Node is not a full Node install. Some built-ins are absent.

  3. 3

    A relative path that is wrong

    require('./utils') when the file is ./lib/utils.js. Extensions and case both matter.

  4. 4

    ESM and CommonJS mixed

    import in a file loaded as CommonJS, or the reverse. The error can surface as a missing module.

  5. 5

    node_modules was installed for a different platform

    A native module built on Windows, copied to a Linux server.

How to tell which one is yours

Look for the folder:

ls my-script/node_modules | head

Missing entirely is cause 1. Present but missing the one package named is a partial install.

Where to look

The resource's package.json and its node_modules.

How to fix it

Install inside the resource folder:

cd resources/my-script
npm install --omit=dev

Then restart the server. Installing at the server root does not help — resolution starts from the resource.

Still stuck on your own code?

This page is what this error usually means. Paste your console into Server Fixer and it will rank everything in it and tell you what to do first, and if you would rather not touch it, ORBIE can repair the script and hand the resource back ready to drop in.

bug_reportOpen Server Fixer

Errors that travel with this one