SnowdogApps / vuepress-plugin-pdf-export

Vuepress plugin for exporting as PDF without system wide dependencies suitable for headless environments
MIT License
29 stars 7 forks source link

Unknown command: export docs #8

Closed freebuu closed 3 years ago

freebuu commented 3 years ago
2618094@DESKTOP-O2V4TD1:~/DEV/help$ npm run export

> @ export /home/2618094/DEV/help
> vuepress export docs

Unknown command: export docs

package.json

{
  "scripts": {
    "dev": "vuepress dev docs",
    "build": "vuepress build docs",
    "export": "vuepress export docs"
  },
  "devDependencies": {
    "@snowdog/vuepress-plugin-pdf-export": "^1.1.0"
  },
  "dependencies": {
    "vuepress-plugin-medium-zoom": "^1.1.8"
  }
}
2618094@DESKTOP-O2V4TD1:~/DEV/help$ vuepress -v
vuepress/1.7.1 linux-x64 node-v14.15.1

Warning with npm run build:

> vuepress build docs

wait Extracting site metadata...
tip Apply theme @vuepress/theme-default ...
warning An error was encountered in plugin "@snowdog/vuepress-plugin-pdf-export"
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
tip Apply plugin @vuepress/active-header-links (i.e. "@vuepress/plugin-active-header-links") ...
tip Apply plugin @vuepress/search (i.e. "@vuepress/plugin-search") ...
tip Apply plugin @vuepress/nprogress (i.e. "@vuepress/plugin-nprogress") ...
tip Apply plugin medium-zoom (i.e. "vuepress-plugin-medium-zoom") ...
tip Apply plugin @vuepress/last-updated (i.e. "@vuepress/plugin-last-updated") ...

✔ Client
  Compiled successfully in 19.82s

✔ Server
  Compiled successfully in 18.29s

wait Rendering static HTML...
success Generated static files in public.

docs/.vuepress/config.js

module.exports = {
  plugins: [
    ["@snowdog/vuepress-plugin-pdf-export"],
    ["vuepress-plugin-medium-zoom"],
    [
      "@vuepress/last-updated",
      {
        dateOptions: {
          hours12: true,
        },
      },
    ],
  ],
};
Igloczek commented 3 years ago

You need to have vuepress dependency installed in your project

npm install -D vuepress or yarn add -D vuepress

freebuu commented 3 years ago

Yep, it solve my problem - with local dep works fine. Pls add this to README - this plugin dont work with globally installed vuepress

Igloczek commented 3 years ago

I don't think this is necessary, because the Vuepress getting started guide is not advising to use Vuepress that way, nor create-vuepress-site template, and the same problems will appear for all plugins that are extending the Vuepress CLI, because that's how the Node.js work.