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
Cannot read property 'version' of undefined #2866
Comments
I'm having the same issue with I am planning to use the zero config |
The temporary solution is to use POI. It is just as easy as vue-cli to use, but works right this moment. |
Just do |
@joeirimpan solves the issue, but how come? |
@joeirimpan |
Must be introduced by this commit c500512 |
Installing eslint locally works, but of course this still negates the instant prototyping feature. |
Thank you for that! Still curious as to why this solves the issue and why it's not documented. |
Fixed in the latest release. Please reinstall the |
Thanks for the quick response, that fixed the issue with eslint. |
I also followed the tutorial on my windows machine with the same error description from above. Im using Version 4.0.2 (+ @vue/cli-service-global@4.0.2) , installed today :O I can later try using this on a mac. 👍 |
|
In Addition to @OriginalEXE I also needed to add those as local packages: npm install eslint-plugin-vue
npm install babel-eslint |
Indeed. Here is a full list of steps we did for a project:
|
Is there a way to do zero-config With vue-cli 3.x I just needed an With version 4.x and the same |
Seems a bug. I may fix it tomorrow. |
adding eslint didnt fix
editing that line from |
I am using @vue/cli 4.0.4 @vue/cli-service-global 4.0.4 |
What a silly thing happen after crafting a new app. Do you all think it is all right and one should spend the time to find a fix for that? No one mentioned that something like that MUST NOT happen in dev env. If we talk about a serious project (like Vue is), |
@mikizdr I reverted back to 3.12, which works perfectly as documented. I agree that getting the users to (unintentionally) test production releases is not the best approach. Perhaps adding automated tests around the major documented functionality could help prevent such issues in the future. |
So; This still an issue? I am just trying to create a web comp, eslint could be optional (nonsexist) |
@mikizdr @pbastowski @mdiallo224 I can't reproduce the bug with |
@mikizdr To be fair Vue CLI v4 is in prerelease for half a year already. 6 alphas, 4 betas, 9 RCs, and not a single issue has been raised on this problem. We are definitely very serious about this project and not getting users to test production release. Bug happens, no matter how hard you try. Of course, we should try to fix bugs as soon as possible and avoid silly problems to happen again. But there are priorities. I didn't fix this one so soon because:
And, if you do have a solution, PR is welcome. |
This didn't fix it for me (as per my above comment) but I'm using vue cli 4x |
Just to clarify this happens when trying to add packages via the |
@gregbenner Does your project have a |
I found a version and you are 100% right what the issue was @sodatea thank you kindly |
Fixed in 4.0.5 with this PR #4728 |
Problem still persists for me with the latest version.
|
@AuspeXeu What's the output of |
|
|
I'll go thru the migration guide once again and double check everything is in place, thanks for the recommendation! |
I had same problem but solved it by simply running yarn install or npm install. I hope someone out there will find this helpful. |
thanks, it works. |
✖ 1 problem (1 error, 0 warnings) You may use special comments to disable some warnings. When I run my source code, I can see this bug. |
Version
3.1.0
Node and OS info
Node v10.13.0 / npm 6.4.1
Steps to reproduce
npm install -g @vue/cli
npm install -g @vue/cli-service-global
What is expected?
vue serve
should start the prototyping serverWhat is actually happening?
(node:15758) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'version' of undefined
at module.exports (/usr/local/lib/node_modules/@vue/cli-service-global/node_modules/@vue/cli-plugin-eslint/index.js:20:29)
at plugins.forEach (/usr/local/lib/node_modules/@vue/cli-service-global/node_modules/@vue/cli-service/lib/Service.js:79:7)
at Array.forEach ()
at Service.init (/usr/local/lib/node_modules/@vue/cli-service-global/node_modules/@vue/cli-service/lib/Service.js:78:18)
at Service.run (/usr/local/lib/node_modules/@vue/cli-service-global/node_modules/@vue/cli-service/lib/Service.js:204:10)
at Object.exports.serve (/usr/local/lib/node_modules/@vue/cli-service-global/index.js:54:33)
at Command.program.command.description.option.option.action (/usr/local/lib/node_modules/@vue/cli/bin/vue.js:104:53)
at Command.listener (/usr/local/lib/node_modules/@vue/cli/node_modules/commander/index.js:315:8)
at Command.emit (events.js:182:13)
at Command.parseArgs (/usr/local/lib/node_modules/@vue/cli/node_modules/commander/index.js:654:12)
(node:15758) 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: 1)
(node:15758) [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.
Following this tutorial https://cli.vuejs.org/guide/prototyping.html
cli-plugin-eslint api directory getting resolved as current project directory https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-plugin-eslint/index.js#L8 and so
eslintPkg
becomes undefined.I added plugin to the current directory by
vue add @vue/eslint
and dev server started normally.The text was updated successfully, but these errors were encountered: