node项目引用 node-canvas库后使用 pkg 打包出错问题
打包后运行exe程序 出现
Error: The specified module could not be found.
修改项目 package.json 文件
1 "pkg": { 2 "scripts": "*.js", 3 "assets": [ 9 "node_modules/canvas/**/*" 10 ] 11 }
增加 "node_modules/canvas/**/*" 后使用命令 pkg -c package.json -t win index.js 重新打包

浙公网安备 33010602011771号