Persistent npm corruption? drizzle-kit & other packages failing to install in Node.js 20 environment

Hey Replit Community,

I seem to have run into a fundamental and persistent issue with npm package installation on a project and I’m hoping to learn if others have experienced something similar.

My Environment:

  • Repl Template: nodejs-20, web, postgresql-16
  • package.json setting: "type": "module"
  • Key Dependencies: drizzle-kit, tsx

The Core Problem:
The issue is that npm install reports a successful completion, but key packages (specifically their executable binaries) are not actually being written to the node_modules directory. This results in command not found errors when trying to run scripts defined in package.json, and MODULE_NOT_FOUND when trying to run them directly with node.

This is a silent failure of the installation process.

Troubleshooting Steps Already Taken:
Before posting, I have exhausted all standard and advanced debugging steps I can think of, including:

  1. Clean Re-installs: Multiple attempts using rm -rf node_modules package-lock.json && npm install.
  2. Cache Clearing: Running npm cache clean --force before installing.
  3. Manual Verification: Manually searching the node_modules and node_modules/.bin directories and confirming the expected files for drizzle-kit and tsx are missing.
  4. Configuration Changes: Renaming drizzle.config.ts to drizzle.config.cjs to rule out any ESM vs. CJS module loading conflicts.
  5. Direct Execution: Bypassing npm and npx to call scripts directly with node node_modules/drizzle-kit/bin.cjs push. This fails as expected because the bin.cjs file doesn’t exist.
  6. The Ultimate Step - Environment Recreation: I “Remixed” (forked) the entire project into a brand new, clean environment. The exact same silent installation failure occurred immediately in the new environment after the first npm install.

My Conclusion:
The fact that the issue persisted identically in a brand new, clean environment leads me to believe the problem is not with my specific code configuration, but with the underlying “golden image” or template Replit is using for this particular stack (Node.js 20 + Postgres 16).

My Question for the Community:
Has anyone else encountered this specific type of “ghost” installation, where npm install succeeds but doesn’t actually place the files? If so, have you found any workarounds or solutions beyond filing a support ticket?

Any insights or shared experiences would be incredibly helpful. Thank you!