我正在尝试从我的Node.js项目创建.exe文件。我使用pkg
命令,但当我在命令提示符中输入pkg package.json
时,我收到以下消息:
> pkg@5.8.0
> Warning Babel parse has failed: This experimental syntax requires enabling the parser plugin: "importAssertions". (1:39)
> Warning Cannot include directory %1 into executable.
The directory must be distributed with executable as %2.
%1: node_modules\puppeteer\.local-chromium
%2: path-to-executable/puppeteer
> Warning Cannot include directory %1 into executable.
The directory must be distributed with executable as %2.
%1: node_modules\puppeteer\.local-chromium
%2: path-to-executable/puppeteer
> Warning Failed to make bytecode node10-x64 for file`
我正在使用以下方式导入JSON文件:
import config from "../../config.json" assert {type: "json"}
这是我的package.json文件:package.json 我导入config.json的方式是否有误? 我打包应用程序的方式是否有误? 我生成.exe文件的方式是否有误?