GroupDocs.Assembly for Node.js via Java is published on npm as @groupdocs/groupdocs.assembly. Install it into your project:
npm install @groupdocs/groupdocs.assembly
During installation npm:
Builds the java bridge package, which lets Node.js call the Java API.
Runs the package’s postinstall script, which downloads the GroupDocs.Assembly JAR file (groupdocs-assembly-nodejs-<version>.jar) into node_modules/@groupdocs/groupdocs.assembly/lib/.
GroupDocs.Assembly runs inside a Java virtual machine started by the java bridge, and the JVM keeps the Node.js process alive after your code finishes. Call process.exit() at the end of standalone scripts.
Download the JAR file manually
If the postinstall step cannot download the JAR file (for example, behind a corporate proxy), the package prints a warning when you load it. Download the file again from the package folder:
cd node_modules/@groupdocs/groupdocs.assembly
npm run postinstall
Or download groupdocs-assembly-nodejs-<version>.jar from https://releases.groupdocs.com/java/repo/com/groupdocs/groupdocs-assembly-nodejs/<version>/ and place it in node_modules/@groupdocs/groupdocs.assembly/lib/.
Troubleshooting
node-gyp build errors: install the build tools listed in System Requirements, restart the terminal and run npm install again.
jni.h not found: a JRE is installed instead of a JDK, or JAVA_HOME points to the wrong folder.
Java not found at runtime: set JAVA_HOME and add JAVA_HOME/bin to PATH.
The script does not exit: add process.exit() at the end of the script.
Can not resolve method on Java 16 or later: call require('java').options.push('--add-opens=java.base/java.lang=ALL-UNNAMED') before requiring @groupdocs/groupdocs.assembly. See System Requirements.
Permission errors when writing reports: make sure the process can write to the output folder.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.