ulivz / vuepress-plugin-export

Export your VuePress site to a PDF file
MIT License
90 stars 17 forks source link

Couldn't detect plugin #2

Open zhenquan98 opened 5 years ago

zhenquan98 commented 5 years ago

Hi, when i run the command vuepress export, it shows the below codes and it's not generating pdf... can anyone take a look pls?

wait Extracting site metadata...
tip Apply theme @vuepress/theme-default
warning [vuepress] cannot resolve plugin "export"
tip Apply plugin @vuepress/container (i.e. "@vuepress/plugin-container") ...
tip Apply plugin @vuepress/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 @vuepress/container (i.e. "@vuepress/plugin-container") ...
tip Apply plugin @vuepress/container (i.e. "@vuepress/plugin-container") ...
tip Apply plugin @vuepress/container (i.e. "@vuepress/plugin-container") ...
Unknown command: export
lukasbankel commented 5 years ago

Got the same Error when running npm install vuepress-plugin-export and then vuepress export.

Vuepress Version

$ vuepress --version 
cli.js/1.0.0-alpha.42 win32-x64 node-v10.15.1
zhenquan98 commented 5 years ago

I found a solution for this, I run

cd /path/to/docs
yarn add -D vuepress@next # OR npm install -D vuepress@next
npm install vuepress-plugin-export
vuepress export

And it's working now, I assume that is because i installed vuepress 0.x and did not uninstall correctly before upgrading to 1.x

ulivz commented 5 years ago

Since here are some internal changes of node api in VuePress, you would get stuck in some of the transitional versions, could you check VuePress@1.0.0-alpha.44 and vuepress-plugin-export@0.2.0 and tell me if I close this issue?

HiraveBapu commented 4 years ago

I am still facing same issue. I have recent vuepress v1.2.0 version.

sk-gara commented 4 years ago

I'm experiencing a similar issue. I run vuepress in an Alpine Docker Container and can't use the export Plugin:

docker-compose up --remove-orphans vuepress-export                                                                                                                                                                                  

Recreating vuepress-export ... done
Attaching to vuepress-export
yarn run v1.19.1
$ vuepress export /home/vuepress/docs/
vuepress-export    | Unknown command: export /home/vuepress/docs/
vuepress-export    |
vuepress-export    | tip Did you miss to specify the target docs dir? e.g. vuepress export [targetDir].
vuepress-export    | tip A custom command registered by a plugin requires VuePress to locate your site configuration like vuepress dev or vuepress build.
vuepress-export    |
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
tangcg commented 4 years ago

same

abelranni commented 4 years ago

I could find a solution by adding the script in package.json:

  "scripts": {
    "docs:pdf": "npm run docs:build && cd docs && vuepress export ."
  },

Then run: npm run docs:pdf

Enviroment Info:

  npmPackages:
    @vuepress/core:  1.5.1 
    @vuepress/theme-default:  1.5.1 
    vuepress: ^1.5.0 => 1.5.1 
  npmGlobalPackages:
    vuepress: 1.5.1
knbknb commented 4 years ago

I have installed vuepress-plugin--export globally. So I went into installation dir ~/.nvm/versions/node/v12.14.1/lib/node_modules/vuepress-plugin-export/ and ran npm i --save-dev. This installed a whole lot of modules that vuepress-plugin-export relies on.

Then this output of command vuepress build which did not load vuepress-plugin-export....

wait Extracting site metadata...
tip Apply theme @vuepress/theme-default ...
warning An error was encountered in plugin "vuepress-plugin-export"
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
tip Apply plugin @vuepress/last-updated (i.e. "@vuepress/plugin-last-updated") ...
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") ...

... turned into this (note the warning is gone and tip Apply plugin export appeared)

vuepress build && vuepress export .
wait Extracting site metadata...
tip Apply theme @vuepress/theme-default ...
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
tip Apply plugin @vuepress/last-updated (i.e. "@vuepress/plugin-last-updated") ...
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 export (i.e. "vuepress-plugin-export") ...
wait Rendering static HTML...
success Generated static files in .vuepress/dist.

vuepress export still does not work because by default it wrongly assumes I am running the .html pages at localhost:8080/something/.

ℹ 「wds」: Project is running at http://0.0.0.0:8080/
ℹ 「wds」: webpack output is served from /something/
ℹ 「wds」: Content not from webpack is served from /home/knb/.../.vuepress/public
ℹ 「wds」: 404s will fallback to /index.html
info Start to generate current site to PDF ...
Language does not exist: {sh}
TimeoutError: Navigation Time
Jiyr0119 commented 2 years ago

I could find a solution by adding the script in package.json:

  "scripts": {
    "docs:pdf": "npm run docs:build && cd docs && vuepress export ."
  },

Then run: npm run docs:pdf

Enviroment Info:

  npmPackages:
    @vuepress/core:  1.5.1 
    @vuepress/theme-default:  1.5.1 
    vuepress: ^1.5.0 => 1.5.1 
  npmGlobalPackages:
    vuepress: 1.5.1

works for me