screenshots icon indicating copy to clipboard operation
screenshots copied to clipboard

升级到 0.5.6 版本后打包主进程报错

Open bruceauyeung opened this issue 1 year ago • 3 comments

Describe the bug 0.5.2版本没这个问题的 下面是在vscode中启动debug时报的错。打包成exe后报一样的错误。 把 node-screenshots等3个,加入到 node-screenshots, asarUnpacked里面也没用。(用的electron-builder) windows,linux都存在该错误。 看起来和你升级 node-screenshots 有关系。

-  Bundling main process...

 WARNING  Compiled with 26 warnings18:33:12

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.android-arm-eabi.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.android-arm64.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.darwin-arm64.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.darwin-x64.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.freebsd-x64.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.linux-arm-gnueabihf.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.linux-arm64-gnu.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.linux-arm64-musl.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.linux-x64-gnu.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.linux-x64-musl.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.win32-arm64-msvc.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.win32-ia32-msvc.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve './node-screenshots.win32-x64-msvc.node' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve 'node-screenshots-android-arm-eabi' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve 'node-screenshots-android-arm64' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve 'node-screenshots-darwin-arm64' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve 'node-screenshots-darwin-x64' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve 'node-screenshots-freebsd-x64' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve 'node-screenshots-linux-arm-gnueabihf' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve 'node-screenshots-linux-arm64-gnu' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve 'node-screenshots-linux-arm64-musl' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve 'node-screenshots-linux-x64-gnu' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve 'node-screenshots-linux-x64-musl' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve 'node-screenshots-win32-arm64-msvc' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots/index.js

Module not found: Error: Can't resolve 'node-screenshots-win32-x64-msvc' in 'D:\path\to\myproject\node_modules\node-screenshots'

 warning  in ./node_modules/node-screenshots-win32-ia32-msvc/node-screenshots.win32-ia32-msvc.node

Module parse failed: Unexpected character '�' (1:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)

 @ ./node_modules/node-screenshots/index.js 79:28-71
 @ ./src/screenshotsGetSourcesHandler.ts
 @ ./src/background.ts
 @ ./src/entry.ts
 @ multi ./src/entry.ts

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Reproduce repository You can fork the repository below to test https://github.com/nashaofu/electron-screenshots-issue

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • OS: [e.g. iOS]
  • Electron [e.g. 16.0.0]
  • electron-screenshots [e.g. 0.5.0]

Additional context Add any other context about the problem here.

bruceauyeung avatar Jul 14 '22 10:07 bruceauyeung

什么系统?

nashaofu avatar Jul 14 '22 15:07 nashaofu

什么系统?

win10 64bit, 和另一个自定义linux都存在该问题

bruceauyeung avatar Jul 15 '22 00:07 bruceauyeung

你删除node_modules,然后重新安装依赖试试,我这边是可以的,https://github.com/nashaofu/dingtalk/releases/tag/v2.1.21, 这个是用的最新版本的截图插件打包的,我在windows上可以使用

nashaofu avatar Jul 15 '22 01:07 nashaofu