Vuepress: Documentation suggestion for when locally installed

Created on 30 Apr 2018  路  7Comments  路  Source: vuejs/vuepress

I was going to just submit this as a documentation pull request in the form of a tip, but as I tried to correctly word it, I realized I'm not sure where or how I should really submit this. Happy to take another crack at a real pull request if that makes sense.

The minor issue I ran into was that the intellisense and great functionality from vetur in VS Code wasn't working after installing vuepress locally to a project that doesn't otherwise use vue. After some confusion and a bit of trial and error, I realized that vetur is explicitly looking for vue to appear in the project's package.json file even though installing vuepress installs it as a dependency.

There is an incredibly simple workaround/answer of just also running yarn add -D vue and I'm guessing most current users would already have that installed locally. However, I'm a big fan of this project and had an immediate use to create some non-web-dev documentation and I'm guessing more people will start doing so as well.

I see two potential longer term approaches and that is why I'm creating this issue that hopefully both @yyx990803 and @octref might see.

  1. Add a simple note/tip to the Getting Started guide to suggest installing vue locally to get the full functionality from vetur
  2. Consider an update to vetur to look for a locally installed node_modules/vue instead of checking for the entry in package.json

To clarify what I found, I didn't actually have to run an "install", but I just added vue to my package.json dependencies and restarted VS Code in order for everything to start working.

A side note, thanks for all the great work on vuepress, vetur, Vue, and all the other related projects and efforts.

help wanted

All 7 comments

Thanks for your reporting!

Hey, @octref, Is vetur able to to looking for the dependencies in package-lock.json or yarn.lock, maybe it will be a better fix for this issue IMO.

@octref do you have any idea for that ?

Vetur needs to know the Vue version installed, as we use a different completion system to support Vue < 2.5 which does not have good typings.
I can do option 2. This will be tracked in vuejs/vetur#799.

@octref Cool, thanks!

We're closing this issue as stale as it's more than 20 days without activity, and without an associated Pull Request. Please feel free to continue discussion. We'll reopen this issue if anything actionable is posted.

The Vetur issue is fixed and will be released in next version.

@octref Cool!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alinnert picture alinnert  路  3Comments

genedronek picture genedronek  路  3Comments

cfjedimaster picture cfjedimaster  路  3Comments

lileiseven picture lileiseven  路  3Comments

higuoxing picture higuoxing  路  3Comments