9 days ago
Fix the npm install/build error in this project.
The deployment currently fails while building the native dependency "deasync":
npm error path /app/node_modules/deasync
npm error command sh -c node ./build.js
node v24.21.0
node-gyp v8.4.1
Python 3.13.5
ModuleNotFoundError: No module named 'distutils'
Please inspect the project's package.json, package-lock.json and deployment configuration.
Make the smallest safe changes necessary to get npm install working on Railway. In particular:
- Check whether the project really needs "deasync".
- If it is required, use a version/configuration compatible with the Node.js version used by the project, or update the native build tooling appropriately.
- Prefer a stable Node.js LTS version supported by the project's dependencies instead of Node 24 if necessary.
- Do not simply disable npm install errors or use --ignore-scripts.
- Do not remove dependencies unless you verify they are unused.
- Update package.json/package-lock.json and deployment configuration as necessary.
- After making changes, run npm install and verify that it completes successfully.
- Do not modify the bot's commands or functionality.
The important error is:
ModuleNotFoundError: No module named 'distutils'
Please fix the underlying compatibility problem and give me the exact files/changes you made.
2 Replies
9 days ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 9 days ago
9 days ago
I'd try updating the node-gyp package to a newer version (v10+). Also, you can try downgrading the Node version being used from 24 to 20.
9 days ago
I think the main issue here is node-gyp 8.4.1 running with Python 3.13.5. Python 3.12+ removed distutils, so that older node-gyp version can break exactly like this.
Before changing a bunch of stuff though, could you share the repo or at least the package.json + package-lock.json?
I’d first check which version of deasync is actually being installed and whether it’s a direct dependency or coming from another package. Then we can figure out whether the cleanest fix is updating deasync/node-gyp or just pinning a different Node version.