nexe -i ./index.js -o Thumbnailer.bin -p /usr/bin/python2 --build
使用nexe并尝试运行我的Binary后,我收到以下错误消息:
╰─$ ./Thumbnailer.bin
internal/modules/cjs/loader.js:596
throw err;
^
Error: Cannot find module 'package.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
at f (/home/lwolf/Projekte/Thumbnailer/Thumbnailer.bin:33356:1092)
at u (/home/lwolf/Projekte/Thumbnailer/Thumbnailer.bin:33356:1430)
at c (/home/lwolf/Projekte/Thumbnailer/Thumbnailer.bin:33356:2750)
at b.require (/home/lwolf/Projekte/Thumbnailer/Thumbnailer.bin:33356:3346)
at Object.<anonymous> (/home/lwolf/Projekte/Thumbnailer/Thumbnailer.bin:8401:26)
at c (/home/lwolf/Projekte/Thumbnailer/Thumbnailer.bin:33356:3584)
在index.js中,我只需要:
const puppeteer = require('puppeteer');