Skip to content
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

Unexpected token '.' #25

Open
captv89 opened this issue Jun 28, 2021 · 4 comments
Open

Unexpected token '.' #25

captv89 opened this issue Jun 28, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@captv89
Copy link

captv89 commented Jun 28, 2021

OS: Windows 10

Running the example command for Docusaurus v2 fails with the message Unexpected token '.'

Command:

npx mr-pdf --initialDocURLs="https://docusaurus.io/docs/" --contentSelector="article" --paginationSelector=".pagination-nav__item--next > a" --excludeSelectors=".margin-vert--xl a" --coverImage="https://docusaurus.io/img/docusaurus.png" --coverTitle="Docusaurus v2"

Screenshot:
image

@pankaj-pant
Copy link

I was having this issue on a Mac as well. For me the issue was happening due to the version of node that I was using. On node v12.22.1 this error was being generated. For work I need to switch between different version of node regularly, so I used nvm to change the node version to v14.17.0, and the pdf generated successfully. Hope this helps.

@BjarkeNL
Copy link

BjarkeNL commented Dec 9, 2022

Are you using NVM for windows? I experienced something similar with NPX and with the same error message (when installing docusaurus with npx).

What worked for me was to upgrade "NVM for windows" to the latest version. (https://github.com/coreybutler/nvm-windows)

Afterwards, you also have to reinstall the node version(s) causing problems, see: npm/cli#4234 (comment)

@kohheepeace
Copy link
Owner

Close the issue according to the @pankaj-pant solution. Thanks!

@kohheepeace
Copy link
Owner

Re-open this issue. Benefits when considering Dockerize.

@kohheepeace kohheepeace reopened this Jun 30, 2023
@kohheepeace kohheepeace added the enhancement New feature or request label Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants