主页 > 游戏开发  > 

【Electron】electron-builder打包失败问题记录

【Electron】electron-builder打包失败问题记录

文章目录 yarn下载的包不支持require()winCodeSign-2.6.0.7z下载失败nsis-3.0.4.1.7z下载失败待补充...

yarn下载的包不支持require()

报错内容:

var stringWidth = require('string-width') ^ Error [ERR_REQUIRE_ESM]: require() of ES Module /stuff/node_modules/string-width/index.js from /stuff/node_modules/wide-align/align.js not supported. Instead change the require of index.js in /stuff/node_modules/wide-align/align.js to a dynamic import() which is available in all CommonJS modules. at Object.<anonymous> (/stuff/node_modules/wide-align/align.js:2:19) at Object.<anonymous> (/stuff/node_modules/gauge/render-template.js:2:13) at Object.<anonymous> (/stuff/node_modules/gauge/plumbing.js:3:22) at Object.<anonymous> (/stuff/node_modules/gauge/index.js:2:16) at Object.<anonymous> (/stuff/node_modules/npmlog/log.js:3:13) at Object.<anonymous> (/stuff/node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js:23:13) at Object.<anonymous> (/stuff/node_modules/@mapbox/node-pre-gyp/lib/main.js:9:22) at Object.<anonymous> (/stuff/node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp:4:1) {

github issue

github /isaacs/jackspeak/issues/5

解决方法: 不用yarn下载,改用npm

winCodeSign-2.6.0.7z下载失败 registry.npmmirror /binary.html?path=electron-builder-binaries/winCodeSign-2.6.0/

下载后找到以下位置,将压缩包解压到electron-builder的cache文件夹中

C:\Users\admin\AppData\Local\electron-builder\Cache

nsis-3.0.4.1.7z下载失败 registry.npmmirror /binary.html?path=electron-builder-binaries/nsis-3.0.4.1/

下载后找到以下位置,将压缩包解压到electron-builder的cache文件夹中

C:\Users\admin\AppData\Local\electron-builder\Cache\nsis

待补充…
标签:

【Electron】electron-builder打包失败问题记录由讯客互联游戏开发栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“【Electron】electron-builder打包失败问题记录