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:

  1. GitHub Repository - package.json is correct:
"jsonwebtoken": "^9.1.2",  
  1. Local File - package.json is valid JSON with proper formatting (verified with Python json.tool)
  2. Git History - The dependency line is correctly formatted in all recent commits
  3. Raw GitHub File - Confirmed via https://raw.githubusercontent.com/thaluaclub/noidacircle-api/main/package.json - shows correct format

Troubleshooting Attempted:

  • Added NO_CACHE=1 environment 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:

  1. Railway's Git integration is fetching a stale/cached version of package.json
  2. Character encoding issue where : is being read as o
  3. npm is reading a corrupted version of the file

Build Details:

  • Repository: thaluaclub/noidacircle-api
  • Branch: main
  • Recent commits tried: 903b19f, 4cfd646, c680b1c
$10 Bounty

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.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...