nativescript-vue / vue-cli-plugin-nativescript-vue

A vue cli 3.x plugin for NativeScript-Vue
MIT License
138 stars 27 forks source link

Error with vue add vue-cli-plugin-nativescript-vue #39

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi guys, again,

Hope you are all well !

I have the following error while running vue add vue-cli-plugin-nativescript-vue, any way to solve that ?

% vue add vue-cli-plugin-nativescript-vue

šŸ“¦  Installing vue-cli-plugin-nativescript-vue...

+ vue-cli-plugin-nativescript-vue@0.3.1
added 36 packages from 22 contributors in 51.848s

11 packages are looking for funding
  run `npm fund` for details

āœ”  Successfully installed plugin: vue-cli-plugin-nativescript-vue

? Enter a unique application identifier: org.nativescript.quizzTemplate
? Use HTML5 history mode? (Default: hash mode) No
? Is this a brand new project? (Default: Yes) No
? Dual Native AND Web development experience or a Native only? (Default: Dual) Dual Native AND Web
? What type of template do you want to start with? (Default: Simple) Simple

šŸš€  Invoking generator for vue-cli-plugin-nativescript-vue...
 ERROR  TypeError: Cannot read property 'split' of undefined
TypeError: Cannot read property 'split' of undefined
    at module.exports (/Users/xxxxxxxx/go/src/github.com/eedama/quiz-for-kids.bck/node_modules/vue-cli-plugin-nativescript-vue/generator/index.js:41:62)
    at Generator.initPlugins (/Users/xxxxxxxx/.nvm/versions/node/v12.14.1/lib/node_modules/@vue/cli/lib/Generator.js:150:13)
    at Generator.generate (/Users/xxxxxxxx/.nvm/versions/node/v12.14.1/lib/node_modules/@vue/cli/lib/Generator.js:168:16)
    at runGenerator (/Users/xxxxxxxx/.nvm/versions/node/v12.14.1/lib/node_modules/@vue/cli/lib/invoke.js:109:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
    at async invoke (/Users/xxxxxxxx/.nvm/versions/node/v12.14.1/lib/node_modules/@vue/cli/lib/invoke.js:90:3)

Thanks in advance

Cheers, X

RedKenrok commented 4 years ago

Ran into the same problem. Simple create a package.json in the root of where you want to add the plug-in with the version field specified. For example:

{
  "name": "my-app",
  "version": "0.0.0"
}

Should solve the issue, although a fix to the module should be made. It should either check if a version is specified or it uses a default version.