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

Error when installing plugin to project using vue-cli 3 #11

Closed
sevillaarvin opened this issue Apr 28, 2019 · 4 comments · Fixed by #12
Closed

Error when installing plugin to project using vue-cli 3 #11

sevillaarvin opened this issue Apr 28, 2019 · 4 comments · Fixed by #12

Comments

@sevillaarvin
Copy link

sevillaarvin commented Apr 28, 2019

I tried using vue create project-name as well as vue ui with default preset (babel, eslint) as well as default plugin options to create my project but I'm still receiving this error.

$ npm --version
6.9.0
$ npm list -g --depth=0
@vue/cli@3.6.3
+ vue-cli-plugin-nativescript-vue@0.0.14
added 18 packages from 6 contributors and audited 24842 packages in 14.756s
found 0 vulnerabilities

 ERROR  TypeError: Cannot read property '1' of null
TypeError: Cannot read property '1' of null
    at module.exports.extractCallDir (/home/aes/Sandbox/zen-code-sharing/node_modules/vue-cli-plugin-nativescript-vue/generator/index.js:907:78)
    at module.exports.renderDirectoryStructure (/home/aes/Sandbox/zen-code-sharing/node_modules/vue-cli-plugin-nativescript-vue/generator/index.js:847:27)
    at /home/aes/Sandbox/zen-code-sharing/node_modules/vue-cli-plugin-nativescript-vue/generator/index.js:199:11
    at Generator.resolveFiles (/usr/lib/node_modules/@vue/cli/lib/Generator.js:209:13)
    at processTicksAndRejections (internal/process/task_queues.js:88:5)
    at async Generator.generate (/usr/lib/node_modules/@vue/cli/lib/Generator.js:116:5)
    at async runGenerator (/usr/lib/node_modules/@vue/cli/lib/invoke.js:133:3)
    at async invoke (/usr/lib/node_modules/@vue/cli/lib/invoke.js:117:3)
Error: Command failed: vue invoke vue-cli-plugin-nativescript-vue --$inlineOptions {"applicationId":"org.nativescript.application","historyMode":false,"isNewProject":true,"isNativeOnly":false,"templateType":"simple"}
adding to package.json
deleting from package.json
doing template rendering

🚀  Invoking generator for vue-cli-plugin-nativescript-vue...

    at makeError (/usr/lib/node_modules/@vue/cli/node_modules/execa/index.js:174:9)
    at /usr/lib/node_modules/@vue/cli/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:88:5) {
  code: 1,
  stdout: 'adding to package.json\ndeleting from package.json\ndoing template ' +
    'rendering\n\n🚀  Invoking generator for ' +
    'vue-cli-plugin-nativescript-vue...\n',
  stderr: null,
  failed: true,
  signal: null,
  cmd: 'vue invoke vue-cli-plugin-nativescript-vue --$inlineOptions ' +
    '{"applicationId":"org.nativescript.application","historyMode":false,"isNewProject":true,"isNativeOnly":false,"templateType":"simple"}',
  timedOut: false,
  killed: false
}

package.json

{
  "name": "zen-code-sharing",
  "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": "^2.6.5",
    "vue": "^2.6.10"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^3.6.0",
    "@vue/cli-plugin-eslint": "^3.6.0",
    "@vue/cli-service": "^3.6.0",
    "babel-eslint": "^10.0.1",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.0.0",
    "vue-cli-plugin-nativescript-vue": "0.0.14",
    "vue-template-compiler": "^2.5.21"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "rules": {},
    "parserOptions": {
      "parser": "babel-eslint"
    }
  },
  "postcss": {
    "plugins": {
      "autoprefixer": {}
    }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
}

@jawa-the-hutt
Copy link
Collaborator

I have been able to reproduce this. It does not happen in npm 6.4.1, but does with npm 6.9.0. Will try and determine what is going on and get this fixed.

jawa-the-hutt added a commit that referenced this issue Apr 29, 2019
Fix #11 - fix extractCallDir for npm 6.9.0
jawa-the-hutt added a commit that referenced this issue Apr 29, 2019
@jawa-the-hutt
Copy link
Collaborator

jawa-the-hutt commented Apr 29, 2019

As an addendum, it appears that nodejs/node#26738 changed the way Error.captureStackTrace works to some degree or another, so the extractCallDir method in the plugin's generator wasn't working due to the regex no longer matching.

I reworked the method to get it working again.

This should now be fixed in 0.0.15 which was just pushed to the npm registry.

@sevillaarvin
Copy link
Author

It works now. Thank you!

@luiguild
Copy link

this problem still exist... :(

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

Successfully merging a pull request may close this issue.

3 participants