Failed to Install Aspose.Slides for Node.js via .NET on macOS

Hi team,

I am exploring and trying to install aspose.slides for node.js via .net using the instructions for mac at Installation|Aspose.Slides for Node.js via .NET Documentation

I have tried using npm install aspose.slides.via.net. This installs the lib. On running sample hello.js, it crashes inside this file:

/node_modules/aspose.slides.via.net/lib/FuncContext.js ,

Here it refers to Apose.Slides.SharedAPI.NET6.dll instead of dylib. This seems like it is getting installed for windows environment only.

Can you please help in installing the correct lib for mac ?

Thanks

@pankajku

Can you please provide more details about the error message you are encountering when trying to install Aspose.Slides for Node.js via .NET on macOS?

Exact error message is this:

undefined:1
(function (f, ctx) { return function (d, cb) { return f(d, cb, ctx); }; })
                                                      ^
Error
    at Object.createInstance (<anonymous>:1:55)
    at Function._internalCreateCLRObject (/Users/damkaur/Documents/ppt-on-web/ppt-on-web-v1/node_modules/aspose.slides.via.net/lib/BaseOperationContext.js:130:48)
    at new Presentation (/Users/damkaur/Documents/ppt-on-web/ppt-on-web-v1/node_modules/aspose.slides.via.net/lib/Presentation.js:27:45)
    at createEmptyPresentation (/Users/damkaur/Documents/ppt-on-web/ppt-on-web-v1/MyDotNetApp/hello.js:15:29)
    at Object.<anonymous> (/Users/damkaur/Documents/ppt-on-web/ppt-on-web-v1/MyDotNetApp/hello.js:24:1)
    at Module._compile (node:internal/modules/cjs/loader:1123:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  TargetSite: '',
  Message: '',
  Data: '',
  InnerException: '',
  HelpLink: '',
  Source: '',
  HResult: '',
  StackTrace: '',
  Name: ''
}

However, after debugging we found that the issue is that it is trying to link to .dll file, post which it crashes

@pankajku,
We are sorry that you encountered this problem. We need more details to investigate the case and help you. Please share the following additional information:

  • code example to reproduce the error
  • macOS version on which the error occurs
  • Node.js version you are using

node version - v16.17.1
macOS version - 13.2.1 (22D68)
code example: same as on this link- Installation|Aspose.Slides for Node.js via .NET Documentation

// Import the Aspose.Slides module for PowerPoint file manipulation
const asposeSlides = require('aspose.slides.via.net');

// Add necessary classes from the asposeSlides
const { Presentation, SaveFormat, PdfOptions } = asposeSlides;

const fs = require('fs');
if (!fs.existsSync("out")) fs.mkdirSync("out");

// Create and save an empty presentation to demonstrate basic functionality
function createEmptyPresentation() {
	
    // Initialize a new empty presentation
    var emptyPresentation = new Presentation();
    
    // Save the empty presentation in PPTX format
    emptyPresentation.save("out/emptyPresentation.pptx", SaveFormat.Pptx);
    
    // Release resources associated with the presentation
    emptyPresentation.dispose();
}

createEmptyPresentation(); // Execute the function to create an empty presentation

@pankajku,
Thank you for the details. Please note that Aspose.Slides for Node.js via .NET requires .NET 6 or above installed on the OS. Could you please confirm that you have installed it?