Closed Jennetiero closed 3 years ago
@Jennetiero. Hi. Which version you use? And how did you setup?
first of all i installed with "yarn add --dev i18n-unused". then added i18n-unused.config.js file to root folder with these code:
module.exports = { // array of files extensions, like ['js', 'vue'] extensions: ['js', 'ts', 'jsx', 'tsx', 'vue'], // array of extensions of locales files, like ['js', 'json'] localesExtensions: ['json'], // path where analyze files srcPath: 'src', // path, where plased locales files localesPath: 'src/i18n/ru.ts', // if substring contain key, it'll ignore excludeKey: '.props.', // custom marker for unused translations marker: '[UNUSED]', // check git log status gitCheck: false };
I use 0.0.8 version
So. Your error looks like Windows problem with cmd node running. By default (from cmd
for example) it may haven't a link on the system. It means that cmd
will not resolve paths to node_modules
. You can try run node ./node_modules/i18n-unused
so, i got this: `internal/modules/cjs/loader.js:969 throw err; ^
Error: Cannot find module 'fs/promises' Require stack:
I think u work in VSCode. Add to your package.json
to scripts path run command, for example: "unused": "i18n-unused"
, and after run npm run unused
.
@Jennetiero or you can try npx i18n-unused
, it resolve node_modules/.bin
. If it helps, than close issue.
Had this same error around fs/promises
, it was since I was using Node 12, to use this package you MUST be on greater than Node 14 since fs/promises
was exposed starting at that version:
https://nodejs.org/api/fs.html#fs_promises_api
@sethomas hi. In the next minor version, I will make normal compatibility with different node versions. For now 14+ are required. I think I'll publish an update next week.
tried all commands, but everytime i get this: 'i18n-unused' is not recognized as an internal or external command, operable program or batch file.