imjuni / erdia

CLI to generate mermaid.js ER diagram using TypeORM entity
https://imjuni.github.io/erdia/
MIT License
34 stars 0 forks source link

ENOENT: no such file or directory error occurs when package name contains slash #52

Closed bbddmm closed 1 year ago

bbddmm commented 1 year ago

When package name contains slash, svg file cannot be generated.

// package.json

{
  "name": "@bbddmm/api",
> npx ts-node --project ./tsconfig.json -r tsconfig-paths/register ../node_modules/.bin/erdia build -d ./database/dataSource.ts -o ./erd --format html

 ERROR  ENOENT: no such file or directory, open '/home/bbddmm/api/erd/@bbddmm/api.svg'       2:16:02 PM
imjuni commented 1 year ago

When erdia gets the project name from the package.json name field, this happens because the slash character used to represent npm scope cannot be applied to the filename.

You can use the filename as a db name by setting the project-name option to db, or use something like @bbddmm_api using version next

imjuni commented 1 year ago

fixed 3.4.0