Repository navigation
Can't Edit file #481
Description
Description
When configured with a custom sub-path prefix ("prefix": "/cmd") and running with "online": true or false, opening any file with the built-in editor (edward or dword) triggers a 404 error for the static editor scripts (edward.js / dword.js).
This issue persists even when accessing the server directly via local IP and port, completely bypassing Nginx, indicating it is an internal routing/path-joining bug inside Cloud Commander's editor server modules.
Environment
- OS: Ubuntu 18.04 LTS
- Node.js Version: v20.20.2 (Installed via NVM)
- Cloud Commander Version: Latest (Global npm installation)
- Deployment: Systemd Service + Local config file
Configuration (/root/c.json)
{
"auth": false,
"port": 8081,
"ip": "127.0.0.1",
"root": "/root/web",
"online": true,
"console": true,
"prefix": "/cmd",
"prefixSocket": "/cmd",
"editor": "edward"
}Logs and Screenshots
1. Backend Service Log (Systemd)
When opening a file to edit, the backend immediately throws a createHttpError from the send dependency, specifically originating from _joinFn in edward/server/index.js (or dword if using dword):
Sep 28 02:08:26 <YOUR_HOST_NAME> node: at createHttpError (/.nvm/versions/node/v20.20.2/lib/node_modules/cloudcmd/node_modules/send/index.js:861:12)
Sep 28 02:08:26 <YOUR_HOST_NAME> node: at SendStream.error (/.nvm/versions/node/v20.20.2/lib/node_modules/cloudcmd/node_modules/send/index.js:168:31)
Sep 28 02:08:26 <YOUR_HOST_NAME> node: at SendStream.pipe (/.nvm/versions/node/v20.20.2/lib/node_modules/cloudcmd/node_modules/send/index.js:468:14)
Sep 28 02:08:26 <YOUR_HOST_NAME> node: at sendfile (/.nvm/versions/node/v20.20.2/lib/node_modules/cloudcmd/node_modules/express/lib/response.js:1014:8)
Sep 28 02:08:26 <YOUR_HOST_NAME> node: at ServerResponse.sendFile (/.nvm/versions/node/v20.20.2/lib/node_modules/cloudcmd/node_modules/express/lib/response.js:411:3)
Sep 28 02:08:26 <YOUR_HOST_NAME> node: at staticFn (/.nvm/versions/node/v20.20.2/lib/node_modules/cloudcmd/node_modules/edward/server/index.js:195:9)
Sep 28 02:08:26 <YOUR_HOST_NAME> node: at Layer.handle [as handle_request] (/.nvm/versions/node/v20.20.2/lib/node_modules/cloudcmd/node_modules/router/lib/layer.js:93:5)
Sep 28 02:08:26 <YOUR_HOST_NAME> node: at next (/.nvm/versions/node/v20.20.2/lib/node_modules/cloudcmd/node_modules/router/lib/route.js:161:13)
Sep 28 02:08:26 <YOUR_HOST_NAME> node: at _joinFn (/.nvm/versions/node/v20.20.2/lib/node_modules/cloudcmd/node_modules/edward/server/index.js:139:16)
Sep 28 02:08:26 <YOUR_HOST_NAME> node: at currify (/.nvm/versions/node/v20.20.2/lib/node_modules/cloudcmd/node_modules/currify/lib/currify.js:16:16)
2. Frontend Browser Console Log (Chrome)
Correspondingly, the browser receives a 404 Not Found with a fallback text/html body instead of JavaScript, leading to strict MIME type enforcement failures:
GET https://<YOUR_DOMAIN>/cmd/edward/edward.js net::ERR_ABORTED 404 (Not Found)
Refused to execute script from 'https://<YOUR_DOMAIN>/cmd/edward/edward.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Root Cause Analysis
The bug seems to be located in the editor's path resolution middleware (_joinFn).
When a user sets "prefix": "/cmd", the asset URLs requested by the browser contain the prefix (e.g., /cmd/edward/edward.js).
The _joinFn inside edward/server/index.js (and dword) fails to properly strip or handle the prefix value before mapping the request onto the local filesystem's absolute path within the global node_modules directory. As a result, Express attempts to search for a non-existent physical subdirectory containing the word cmd, throwing a 404 static asset error.
Steps to Reproduce
- Configure
prefixto"/cmd"inc.json. - Start Cloud Commander using the config file.
- Access the file manager (via Nginx reverse proxy or direct local port IP).
- Right-click any file and select Edit.
- Observe the backend log and browser DevTools Network tab.

Activity
fix: support custom url prefix for editors coderaiser#481
fix: sever: prefix (#481)
coderaiser commentedon Sep 29, 2026
Just fixed in v19.21.1🎉. Is it works for you?
yangzhinong commentedon Sep 29, 2026
Sorry, I discovered that the issue likely stemmed from my nvm environment; in that environment, I couldn't edit files regardless of whether I installed Node 20 or Node 24 or cloudcmd 19.21.1. I eventually bypassed nvm and installed Node 24.21.0 and npm 11.19.0 directly, and everything started working normally—including the ability to edit files using cloudcmd 19.21.0.