electron打包错误

按照官方文档执行到这一步
npx electron-forge import

✔ Checking your system
✔ Initializing Git Repository
✔ Writing modified package.json file
✖ Installing dependencies

An unhandled error has occurred inside Forge:
Failed to install modules: ["electron-squirrel-star

With output: Command failed with a non-zero return 
npm install electron-squirrel-startup --save

npm WARN ERESOLVE overriding peer dependency
npm WARN Found: typescript@4.2.3
npm WARN node_modules/tslint-xo/node_modules/typesc
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer typescript@"^2.2.0 || ^3.0.0" from ts
npm WARN node_modules/tslint-xo/node_modules/tslint
npm WARN   tslint-eslint-rules@"^5.4.0" from tslint
npm WARN   node_modules/tslint-xo
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: typescript@4.2.3
npm WARN node_modules/tslint-xo/node_modules/typesc
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer typescript@"^2.1.0 || ^3.0.0" from ts
npm WARN node_modules/tslint-xo/node_modules/tslint
npm WARN   tslint-microsoft-contrib@"^5.2.1" from t
npm WARN   node_modules/tslint-xo
npm WARN deprecated multiline@2.0.0: This was a fun
literals, so use that instead.
npm WARN deprecated request-promise-native@1.0.9: reprecated because it extends the now deprecated req.com/request/request/issues/3142
npm WARN deprecated minimatch@2.0.10: Please update avoid a RegExp DoS issue
npm WARN deprecated left-pad@1.3.0: use String.prot
npm WARN deprecated fsevents@1.2.13: fsevents 1 wile using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated node-pre-gyp@0.15.0: Please upg: the non-scoped 'node-pre-gyp' package is deprecatackage will recieve updates in the future
npm WARN deprecated core-js@2.6.12: core-js@<3 is nmmended for usage due to the number of issues. Plea the actual version of core-js@3.
npm WARN deprecated core-js@2.6.12: core-js@<3 is nmmended for usage due to the number of issues. Plea the actual version of core-js@3.
npm WARN deprecated core-js@2.6.12: core-js@<3 is nmmended for usage due to the number of issues. Plea the actual version of core-js@3.
npm ERR! code ENOENT
npm ERR! syscall symlink
npm ERR! path D:\Front_end\技术栈demoes\echarts-demver
npm ERR! dest D:\Front_end\技术栈demoes\echarts-demylus\node_modules\semver
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, es\echarts-demo\node_modules\_semver@6.3.0@semver' harts-demo\node_modules\_stylus@0.54.8@stylus\node_
npm ERR! enoent This is related to npm not being ab
npm ERR! enoent

参考这篇文章修改了npx镜像源,无效。
https://segmentfault.com/q/1010000021786171
明明已经使用cnpm install electron-squirrel-startup --save安装了依赖,但是还是报错,似乎一定要使用npm的亚子,这里没有搞懂。。。
在这里插入图片描述

npm install electron-squirrel-startup --save --no-bin-links仍无法建立文件链接,此时window的文件链接功能应该是打开了的。

npm WARN ERESOLVE overriding peer dependency
npm WARN Found: typescript@4.2.3
npm WARN node_modules/tslint-xo/node_modules/typescript
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer typescript@"^2.2.0 || ^3.0.0" from tslint-eslint-rules@5.4.0
npm WARN node_modules/tslint-xo/node_modules/tslint-eslint-rules
npm WARN   tslint-eslint-rules@"^5.4.0" from tslint-xo@0.10.0
npm WARN   node_modules/tslint-xo
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: typescript@4.2.3
npm WARN node_modules/tslint-xo/node_modules/typescript
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer typescript@"^2.1.0 || ^3.0.0" from tslint-microsoft-contrib@5.2.1npm WARN node_modules/tslint-xo/node_modules/tslint-microsoft-contrib
npm WARN   tslint-microsoft-contrib@"^5.2.1" from tslint-xo@0.10.0
npm WARN   node_modules/tslint-xo
npm WARN deprecated multiline@2.0.0: This was a fun hack, but now we have template literals, so use that instead.
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated node-pre-gyp@0.15.0: Please upgrade to @mapbox/node-pre-gyp@1.x: the non-scoped 'node-pre-gyp' package is deprecated and only the @mapbox 
scoped package will recieve updates in the future
npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not 
recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not 
recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not 
recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! code ENOENT
npm ERR! syscall symlink
npm ERR! path D:\Front_end\技术栈demoes\echarts-demo\node_modules\_mkdirp@0.5.5@mkdirp
npm ERR! dest D:\Front_end\技术栈demoes\echarts-demo\node_modules\_stylus@0.54.5@stylus\node_modules\mkdirp
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, symlink 'D:\Front_end\技术栈
demoes\echarts-demo\node_modules\_mkdirp@0.5.5@mkdirp' -> 'D:\Front_end\技术栈demoes\echarts-demo\node_modules\_stylus@0.54.5@stylus\node_modules\mkdirp'     
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

关键在于:no such file or directory, symlink。然而两个目录都存在,晕~~
猜测是中文引起的目录查询不到,遂将目录改成英文,问题解决。然而又迎来新的报错(吐血):

npm ERR! code 1
npm ERR! path D:\Front_end\Techdemoes\echarts-demo\node_modules\@electron-forge\shared-types\node_modules\lzma-native
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build && rimraf build
npm ERR! [lzma-native] Success: "D:\Front_end\Techdemoes\echarts-demo\node_modules\@electron-forge\shared-types\node_modules\lzma-native\binding-v6.0.1-n-api-win32-x64\lzma_native.node" is installed via remote
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.17.0
npm ERR! node-pre-gyp info using node@14.16.0 | win32 | x64
npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download        
npm ERR! node-pre-gyp info check checked for "D:\Front_end\Techdemoes\echarts-demo\node_modules\@electron-forge\shared-types\node_modules\lzma-native\binding-v6.0.1-n-api-win32-x64\lzma_native.node" (not found)
npm ERR! node-pre-gyp http GET https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-win32-x64.tar.gz
npm ERR! node-pre-gyp http 200 https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-win32-x64.tar.gz
npm ERR! node-pre-gyp info install unpacking binding-v6.0.1-n-api-win32-x64/liblzma.dll
npm ERR! node-pre-gyp info install unpacking binding-v6.0.1-n-api-win32-x64/lzma_native.node
npm ERR! node-pre-gyp info tarball done parsing tarball
npm ERR! node-pre-gyp info ok
npm ERR! 'rimraf' �����ڲ����ⲿ���Ҳ���ǿ����еij���
npm ERR! ���������ļ���

状态码200,可以下载。但是在’rimraf’+奇怪的乱码 上出了问题。度娘一下:

rimraf 包的作用:以包的形式包装rm -rf命令,用来删除文件和文件夹的,不管文件夹是否为空,都可删除.

尝试npm安装rimraf,果然安装报错。改用cnpm安装,完成。再重新执行npm install electron-squirrel-startup --save --no-bin-links
依然报同样的错。明天再写,希望有大佬能解答疑惑。

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

DreamYum

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值