我正在尝试从一个简单的 node.jsexample.js
应用程序创建本机图像。
运行应用程序时:
node --native -i --native example.js
然后应用程序正在启动并按预期工作。
现在我想创建一个原生图像。我尝试了以下命令:
native-image --language:js example.js
但是由于以下错误,它不起作用:
Build on Server(pid: 77626, port: 64052)
[example.js:77626] classlist: 3,964.04 ms
error: Main entry point class 'example.js' not found.
Error: Processing image build request failed
作为一项解决方案,我创建了一个主要入口点,example.js
例如:
function main(args) {
console.log("Main app started")
}
但是这不起作用。
有没有一种方法通常为 js/node.js 应用程序创建原生图像?