dotnet / docfx

Static site generator for .NET API documentation.
https://dotnet.github.io/docfx/
MIT License
4.09k stars 867 forks source link

[Bug] PDF 2.78.1 error PLAYWRIGHT_NODEJS_PATH #10409

Closed JM2K69 closed 1 day ago

JM2K69 commented 2 days ago

Describe the bug

I ♥ PS> docfx -v
2.78.1+602f6c91bc64c0aacb0990a3109a1bd8d7de01fb

To Reproduce Steps to reproduce the behavior:

  1. Enable PDF
  2. Build your site

Expected behavior

D:\Static\web>docfx  docfx.json --serve -p 80
Searching built-in plugins in directory C:\Users\JM2K69\.dotnet\tools\.store\docfx\2.78.1\docfx\2.78.1\tools\net9.0\any\...
Post processor ExtractSearchIndex loaded.
7 plug-in(s) loaded.
3 schema driven document processor plug-in(s) loaded.
Building 19 file(s) in Video(BuildSchemaBasedDocument=>ApplyOverwriteFragments=>ApplyOverwriteDocument)...
Building 49 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>ValidateConceptualDocumentMetadata)...
Building 4 file(s) in Dashboard(BuildSchemaBasedDocument=>ApplyOverwriteFragments=>ApplyOverwriteDocument)...
Building 5 file(s) in Dash(BuildSchemaBasedDocument=>ApplyOverwriteFragments=>ApplyOverwriteDocument)...
Building 4 file(s) in TocDocumentProcessor(BuildTocDocument)...
Building 312 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)...
Applying templates to 393 model(s)...
XRef map exported.
Extracting index data from 77 html files
TypeInitializationException: The type initializer for 'Docfx.Pdf.PdfBuilder' threw an exception.
     DocfxException: Node.js executable is not found. Try to install Node.js or set the `PLAYWRIGHT_NODEJS_PATH`
     environment variable.
       at void EnsurePlaywrightNodeJsPath() in PlaywrightHelper.cs:25
       at cctor() in PdfBuilder.cs:53
  at Task CreatePdf(string outputFolder)
  at void <Execute>b__0() in DefaultCommand.cs:53
  at int Run(LogOptions options, Action run) in CommandHelper.cs:48
  at int Execute(CommandContext context, Options options) in DefaultCommand.cs:31
  at Task<int> Execute(CommandContext context, CommandSettings settings) in CommandOfT.cs:40
  at async Task<int> Execute(CommandTree leaf, CommandTree tree, CommandContext context, ITypeResolver resolver,
     IConfiguration configuration) in CommandExecutor.cs:166

@filzrev

groogiam commented 1 day ago

@JM2K69 Do you have nodejs installed on the machine you are executing docfx on? It looks like node is no longer bundled in the package as of 2.78.

See

https://github.com/dotnet/docfx/releases/tag/v2.78.0 https://github.com/dotnet/docfx/pull/10066

JM2K69 commented 1 day ago

@JM2K69 Do you have nodejs installed on the machine you are executing docfx on? It looks like node is no longer bundled in the package as of 2.78.

See

https://github.com/dotnet/docfx/releases/tag/v2.78.0 #10066

No, on the old versions we didn't need node.js

JM2K69 commented 1 day ago

Yes they removed the dependencies but it seems not...