Skip to content

Error: Cannot find module 'lodash' #4339

Description

@dodocodemj

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions