electron / electron/forge

Error: Cannot find module 'lodash'

Open
#4,339 1 comment 0 reactions 0 assignees View on GitHub
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.

### Forge version

7.11.2

### Electron version

43.2.0

### Operating system

Windows 11

### Last known working Forge version

_No response_

### Expected behavior

electron-forge start to works

### Actual behavior

> plan4@1.0.0 start D:\softs\dev\plutus\plan4
> electron-forge start

✔ Checking your system
✔ Locating application
✖ Loading configuration
› Cannot find module 'lodash'
Require stack:
- D:\softs\dev\plutus\plan4\node_modules\electron-winstaller\lib\index.js
◼ Preparing native dependencies
◼ Running generateAssets hook
◼ Running preStart hook

Failed to load: D:\softs\dev\plutus\plan4\forge.config.ts

An unhandled rejection has occurred inside Forge:
Error: Cannot find module 'lodash'
Require stack:
- D:\softs\dev\plutus\plan4\node_modules\electron-winstaller\lib\index.js
at Function._resolveFilename (node:internal/modules/cjs/loader:1225:15)
at Function.resolve (node:internal/modules/helpers:146:19)
at jitiResolve (D:\softs\dev\plutus\plan4\node_modules\jiti\dist\jiti.cjs:1:176713)
at jitiRequire (D:\softs\dev\plutus\plan4\node_modules\jiti\dist\jiti.cjs:1:178658)
at D:\softs\dev\plutus\plan4\node_modules\jiti\dist\jiti.cjs:1:187397
at D:/softs/dev/plutus/plan4/node_modules/electron-winstaller/lib/index.js:73:16
at eval_evalModule (D:\softs\dev\plutus\plan4\node_modules\jiti\dist\jiti.cjs:1:184467)
at jitiRequire (D:\softs\dev\plutus\plan4\node_modules\jiti\dist\jiti.cjs:1:179335)
at D:\softs\dev\plutus\plan4\node_modules\jiti\dist\jiti.cjs:1:187397
at D:/softs/dev/plutus/plan4/node_modules/@electron-forge/maker-squirrel/dist/MakerSquirrel.js:10:31
at eval_evalModule (D:\softs\dev\plutus\plan4\node_modules\jiti\dist\jiti.cjs:1:184467)
at D:\softs\dev\plutus\plan4\node_modules\jiti\dist\jiti.cjs:1:182582
at async import (D:\softs\dev\plutus\plan4\node_modules\jiti\dist\jiti.cjs:1:187718)
at async D:/softs/dev/plutus/plan4/forge.config.ts:2:22
at async import (D:\softs\dev\plutus\plan4\node_modules\jiti\dist\jiti.cjs:1:187718)
at async exports.default (D:\softs\dev\plutus\plan4\node_modules\@electron-forge\core\dist\util\forge-config.js:180:29)
 ELIFECYCLE  Command failed with exit code 1.

### Steps to reproduce

1. Creating a new app
`pnpm dlx create-electron-app@latest plan4 --template=vite-typescript`
2. Start the app
`cd plan4`
`pnpm start`

### Additional information

_No response_

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.