Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't start #3

Closed
Jennetiero opened this issue Jul 15, 2021 · 8 comments
Closed

Can't start #3

Jennetiero opened this issue Jul 15, 2021 · 8 comments

Comments

@Jennetiero
Copy link

tried all commands, but everytime i get this:
'i18n-unused' is not recognized as an internal or external command,
operable program or batch file.

@mxmvshnvsk
Copy link
Owner

mxmvshnvsk commented Jul 15, 2021

@Jennetiero. Hi. Which version you use? And how did you setup?

@Jennetiero
Copy link
Author

Jennetiero commented Jul 15, 2021

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

@mxmvshnvsk
Copy link
Owner

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

@Jennetiero
Copy link
Author

so, i got this:
`internal/modules/cjs/loader.js:969
throw err;
^

Error: Cannot find module 'fs/promises'
Require stack:

  • C:\Users\User\Desktop\workspace\stat-tm\node_modules\i18n-unused\dist\i18n-unused.umd.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
    at Function.Module._load (internal/modules/cjs/loader.js:842:27)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at C:\Users\User\Desktop\workspace\stat-tm\node_modules\i18n-unused\dist\i18n-unused.umd.js:2:98
    at Object. (C:\Users\User\Desktop\workspace\stat-tm\node_modules\i18n-unused\dist\i18n-unused.umd.js:5:2)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\User\Desktop\workspace\stat-tm\node_modules\i18n-unused\dist\i18n-unused.umd.js'
    ]
    }
    `

@mxmvshnvsk
Copy link
Owner

mxmvshnvsk commented Jul 15, 2021

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.

@mxmvshnvsk
Copy link
Owner

@Jennetiero or you can try npx i18n-unused, it resolve node_modules/.bin. If it helps, than close issue.

@sethomas
Copy link

sethomas commented Sep 2, 2021

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

@mxmvshnvsk
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants