


To install a Node.js package, you can use the npm launcher from the GraalVM’s /bin folder. The node command is largely compatible with Node.js, and features additional GraalVM-specific functionalities (e.g., interoperability with Java and all other GraalVM languages).Ī list of available options can be obtained with node -help. Thus, some internal features (e.g., VM-internal statistics, configuration, profiling, debugging, etc.) are unsupported, or supported with potentially different behavior. GraalVM JavaScript engine instead of Google V8. GraalVM’s Node.js runtime is based on a recent version of Node.js, and runs the To run Node.js-based applications, use the node launcher in the GraalVM distribution: $GRAALVM_HOME/bin/node

$GRAALVM/bin/gu rebuild-images libpolyglotĪfter a successfull rebuild, the polyglot access is also available in the -native mode: $GRAALVM/bin/node -native -polyglot -e 'var array = Polyglot.eval("ruby", "") console.log(array) ' To use the polyglot capabilities of node in the native mode (flag: -native), the libpolyglot needs to be rebuilt first.įor this, the native-image component and the other languages need to be installed first, before the image can be rebuilt: $GRAALVM/bin/gu install native-image use this command: $GRAALVM/bin/node -jvm -polyglot -e 'var array = Polyglot.eval("ruby", "") console.log(array) ' This feature is available by default in JVM mode (flag: -jvm).įor polyglot access to the Ruby language, you can e.g. The Node.js component is able to use the polyglot language interoperability (flag: -polyglot) with other installed polyglot languages. This installs the node and npm binaries in the $GRAALVM/bin directory. It can be installed with the GraalVM Updater. Since GraalVM 21.1, the Node.js support is packaged in a separate GraalVM component. GraalVM can run unmodified Node.js applications.Īpplications can freely import and use NPM packages, including native ones.įor the differences between running the node native launcher and accessing Node.js/npm modules/ECMAScript modules from a Java Context, see NodeJSVSJavaScriptContext.
