You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DB-Migrate typescript plugin lists ts-node as a sub dependency
which causes it to be installed under its own node_modules directory
Since node allows multiple versions of the same library to be installed
and loaded at the same time, the ts-node installed under the plugin
has no access to any dependencies installed in the parent project
node_modules directory, even as cwd points to the proper place
So compilation fails
By moving the dependency to a peer dependency, the ts-node
dependency (if not already installed) is installed in the project
node_modules directory, and so now has access to all other
typescript dependencies
Signed-off-by: Daniel <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ A TypeScript plugin for db-migrate.
6
6
Usage is very simple. Simply install this plugin via `npm install db-migrate-plugin-typescript`
7
7
or if using yarn: `yarn add db-migrate-plugin-typescript`
8
8
9
+
This plugin has a peer dependency on ts-node as well. So you will need to install that as a dependency or dev-dependency as well, `npm install ts-node` or `yarn add ts-node` if using yarn.
10
+
9
11
The plugin will automatically resolve and compile any `.ts` files in your migrations directory,
0 commit comments