cyon / vue-translation-manager

Interactively translate strings in Vue single file components
26 stars 12 forks source link

Local installation does not work #1

Closed rothsandro closed 6 years ago

rothsandro commented 6 years ago

The translate command does not work if the package is installed locally.

Steps to reproduce

  1. Init project with Vue CLI 3
  2. Select Babel only
  3. Install and configure vue-i18n
  4. Install vue-translation-manager locally with npm
  5. Add the configuration file .vue-translation.js (copy from your documentation)
  6. Run ./node_modules/.bin/vue-translation-manager translate
  7. Choose the HelloWorld.vue component

I get the following error: (node:19485) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '../../src/components/HelloWorld.vue' at Object.fs.openSync (fs.js:646:18) at Object.fs.readFileSync (fs.js:551:33) at TranslationManager.getTemplateForSingleFileComponent (node_modules/vue-translation-manager/index.js:53:23) at TranslationManager.getStringsForComponent (node_modules/vue-translation-manager/index.js:69:29) at prompt.then (node_modules/vue-translation-manager/bin.js:155:27) at at process._tickCallback (internal/process/next_tick.js:188:7) (node:19485) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:19485) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

MaxGfeller commented 6 years ago

Thanks for the report, this seems to be because of how we transformed relative paths. Should be fixed in 1.0.3.