Closed breno404 closed 5 months ago
Have you had any luck finding a proper solution to this? Right now I've got a hacky workaround that works but it's annoying to have to do that every time I add a new package.
Since string-width is not an es-module, you will need to use esModuleInterop
till the ecosystem catches up.
@aw1875 still nothing, I'm using bcryptjs as an alternative.
What went wrong? I can't use bcrypt because "string-width\index.js not supported."
What did you expect to happen? Install and run bcrypt
Which version of nodejs and OS? Node: 20.10.0 OS: Windows 11
If you find a bug, please write a failing test.
{ "include": ["src/*/"], "exclude": ["node_modules"], "compilerOptions": { "target": "ES6", "lib": ["ES5", "ES2015", "ES2016", "ES2017", "ES2018"], "module": "Node16" / Specify what module code is generated. /, "rootDir": "src" / Specify the root folder within your source files. /, "moduleResolution": "Node16" / Specify how TypeScript looks up a file from a given module specifier. /, "baseUrl": ".", "paths": { "@/config/": ["./src/config/"], "@/entities/": ["src/models/"], "@/controllers/": ["./src/controllers/"], "@/services/": ["./src/services/"] }, "resolveJsonModule": true / Enable importing .json files. /, "noResolve": false / Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. /,
"allowJs": true / Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. /,
"skipLibCheck": true / Skip type checking all .d.ts files. /
}
}
Run yarn add command: yarn add bcrypt
Try using the dependency: import bcrypt from "bcrypt"
[SCREENSHOTS]: *tsconfig:
*command line:
*import dependency: