Closed bassochette closed 1 year ago
I had a similar problem recently and it turns out the way I was zipping the deployed packages was the problem. You can preserve symbolic links by call zip
with the --symlinks
argument.
Closing this, see last comment for resolution.
Describe the bug Migration works on local environment but does not on the deployed instance. It failed stating: Error: Cannot find module '../lib/migrate-mongo' Symlinks in
node_modules/.bin
are not kept by the ci pipeline and are copies of the executable.To Reproduce Steps to reproduce the behavior: Copy the executable into
node_modules/.bin
to replace the symlink.Expected behavior Should display the migration status
Additional context
internal/modules/cjs/loader.js:892 throw err; ^
Error: Cannot find module '../lib/migrate-mongo' Require stack:
migrate-mongo status -f dist/migrate-mongo-config.js
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the xxx@1.0.0 migrate:status script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm timing npm Completed in 463msnpm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2022-01-03T16_04_12_200Z-debug.log