1

on a fresh install of a Vue3 project, i end up in errors when i try to setup i18n plugin from command line. I did set all the options as the ones by default.

Here is the error i get after installation of the plugin. Also tried in a Vue 3 with Vite project.

➜ vue3-demo git:(master) vue add i18n

Installing vue-cli-plugin-i18n...

yarn add v1.22.5 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.1.3: The platform "linux" is incompatible with this module. info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.13: The platform "linux" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. success Saved 10 new dependencies. info Direct dependencies └─ vue-cli-plugin-i18n@1.0.1 info All dependencies ├─ cli-table3@0.5.1 ├─ colors@1.4.0 ├─ deepmerge@4.2.2 ├─ dot-object@1.9.0 ├─ esm@3.2.25 ├─ flat@5.0.2 ├─ is-valid-glob@1.0.0 ├─ vue-cli-plugin-i18n@1.0.1 ├─ vue-i18n-extract@1.0.2 └─ vue-i18n@8.22.2 Done in 5.46s. ✔ Successfully installed plugin: vue-cli-plugin-i18n

? The locale of project localization. en ? The fallback locale of project localization. en ? The directory where store localization messages of project. It's stored under src directo ry. locales ? Enable locale messages in Single file components ? No

Invoking generator for vue-cli-plugin-i18n... ERROR Error: You cannot call "get" on a collection with no paths. Instead, check the "length" property first to verify at least 1 path exists. Error: You cannot call "get" on a collection with no paths. Instead, check the "length" property first to verify at least 1 path exists. at Collection.get (/usr/local/lib/node_modules/@vue/cli/node_modules/jscodeshift/src/Collection.js:213:13) at injectOptions (/usr/local/lib/node_modules/@vue/cli/lib/util/codemods/injectOptions.js:15:6) at runTransformation (/usr/local/lib/node_modules/@vue/cli/node_modules/vue-codemod/dist/src/run-transformation.js:61:17) at /usr/local/lib/node_modules/@vue/cli/lib/Generator.js:290:23 at Array.forEach () at Generator.resolveFiles (/usr/local/lib/node_modules/@vue/cli/lib/Generator.js:276:24) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Generator.generate (/usr/local/lib/node_modules/@vue/cli/lib/Generator.js:175:5) at async runGenerator (/usr/local/lib/node_modules/@vue/cli/lib/invoke.js:111:3) at async invoke (/usr/local/lib/node_modules/@vue/cli/lib/invoke.js:92:3)

here is my package json file

{
  "name": "vue3-demo",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "core-js": "^3.6.5",
    "vue": "^3.0.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/compiler-sfc": "^3.0.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^7.0.0-0",
    "vue-cli-plugin-i18n": "~1.0.1"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/vue3-essential",
      "eslint:recommended"
    ],
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {}
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}
Ty Kayn
  • 719
  • 7
  • 24

0 Answers0