electron / electron/forge

Cannot find module 'undefinedbuild/Release/sharp-win32-x64.node'

Open
#3,119 4 comments 4 reactions 0 assignees View on GitHub
native-modules
Dominant language
TypeScript
Stars
7.1k
Forks
641
Avg merge
3d 1h
Merged PRs (30d)
30

Description

### Pre-flight checklist

- [X] I have read the [contribution documentation](https://github.com/electron/forge/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project uses.
- [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

### Electron Forge version

6.0.4

### Electron version

22.0.0

### Operating system

Windows 10

### Last known working Electron Forge version

_No response_

### Expected behavior

Should be able to use the `venom-bot` methods, `venom-bot` uses `sharp`
and then **run** and **package** the app

### Actual behavior

After adding the `venom-bot` package when I call the `venom-package` methods it throws following error:

```

App threw an error during load
Error:
Something went wrong installing the "sharp" module

Cannot find module 'undefinedbuild/Release/sharp-win32-x64.node'
Require stack:
- C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js
- C:\Users\admin\Desktop\forge-sharp-example\node_modules\electron\dist\resources\default_app.asar\main.js
-

Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current win32-x64 runtime: "npm install --platform=win32 --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
at ./node_modules/sharp/lib/sharp.js (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:42357:9)
at __webpack_require__ (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:85802:42)
at ./node_modules/sharp/lib/constructor.js (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:38511:1)
at __webpack_require__ (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:85802:42)
at ./node_modules/sharp/lib/index.js (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:38903:15)
at __webpack_require__ (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:85 at __webpack_require__ (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:85802:42)
at ./node_modules/venom-bot/dist/api/helpers/index.js (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:49577:24)
at __webpack_require__ (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:85802:42)

```

### Steps to reproduce

I have added a sample repo:

> Visit [https://github.com/piedpie/forge-sharp-example](https://github.com/piedpie/forge-sharp-example)
> Clone the repo and run

> `npm install`

> `npm start`

### Additional information

I already tried following:

- Install with verbose logging and look for errors:
`npm install --ignore-scripts=false --foreground-scripts --verbose sharp`
- Install for the current win32-x64 runtime:
`npm install --platform=win32 --arch=x64 sharp`

- Aso deleted node_modules and tried
`npm install sharp --ignore-scripts false`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.