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:
- Clean Re-installs: Multiple attempts using
rm -rf node_modules package-lock.json && npm install
. - Cache Clearing: Running
npm cache clean --force
before installing. - Manual Verification: Manually searching the
node_modules
andnode_modules/.bin
directories and confirming the expected files fordrizzle-kit
andtsx
are missing. - Configuration Changes: Renaming
drizzle.config.ts
todrizzle.config.cjs
to rule out any ESM vs. CJS module loading conflicts. - Direct Execution: Bypassing
npm
andnpx
to call scripts directly withnode node_modules/drizzle-kit/bin.cjs push
. This fails as expected because thebin.cjs
file doesn’t exist. - 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!