Skip to content

vuepress@next fails to resolve custom theme when run globally #1568

@stasson

Description

@stasson
  • [ X] I confirm that this is an issue rather than a question.

Bug report

Version

1.0.0-alpha.47

Steps to reproduce

considering such config file

// .vuepress/config.js
module.exports = {
  theme: '@myscope/my-theme'
};

when installing vuepress globally and a custom theme locally

> npm i -g vuepress@next
> npm i  @myscope/vuepress-theme-my-theme

vuepress fail to resolve the custom theme

> vuepress dev .
Error: Cannot find module '@myscope/vuepress-theme-my-theme/package.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.resolve (internal/modules/cjs/helpers.js:32:19)
    at normalizeThemePath (C:\Users\az02080\AppData\Roaming\npm\node_modules\vuepress\node_modules\@vuepress\core\lib\node\loadTheme.js:59:33)

What is expected?

expecting custom theme to be resolved as in cwd.

What is actually happening?

custom theme is not resolved.

Other relevant information

  • Your OS: win10
  • Node.js version: node 10.15.0
  • Browser version: chrome 73
  • Is this a global or local install? global
  • Which package manager did you use for the install? npm
  • Does this issue occur when all plugins are disabled? no

if vuepress installed and run locally , everything is fine, so this is not a critical issue.
Still would be a nice fix: vuepress installed globally in docker while theme installed in repo allows to speed up our CI big time. also nice to have for dev env.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions