Railway Build Failure - npm Dependency Error
thaluaclub
FREEOP
2 months ago
Error Message:
npm error notarget No matching version found for jsonwebtokeno9.1.2
npm error notarget In most cases you or one of your dependencies are requesting
npm error notarget a package version that doesn't exist.
The Issue:
npm is trying to install a package named jsonwebtokeno9.1.2 (malformed - missing colon, concatenated) instead of the correct package jsonwebtoken version ^9.1.2.
What We've Verified:
- GitHub Repository - package.json is correct:
"jsonwebtoken": "^9.1.2", - Local File - package.json is valid JSON with proper formatting (verified with Python json.tool)
- Git History - The dependency line is correctly formatted in all recent commits
- Raw GitHub File - Confirmed via
https://raw.githubusercontent.com/thaluaclub/noidacircle-api/main/package.json- shows correct format
Troubleshooting Attempted:
- Added
NO_CACHE=1environment variable (per Railway docs) - Pushed multiple fresh commits to trigger rebuilds
- Modified package.json (version bump) to force fresh pull
- Verified JSON syntax validity
- Still fails with same error despite all above
Suspected Cause:
Either:
- Railway's Git integration is fetching a stale/cached version of package.json
- Character encoding issue where
:is being read aso - npm is reading a corrupted version of the file
Build Details:
- Repository:
thaluaclub/noidacircle-api - Branch: main
- Recent commits tried: 903b19f, 4cfd646, c680b1c
1 Replies
Status changed to Awaiting Railway Response Railway • 2 months ago
dtknepper
PRO
2 months ago
What I would try to do is remove the package-lock.json and then run npm install again. This should give you a clean version of the package-lock.json and most likely resolve your issue.
