Error: Cannot find module 'chokidar'

Open
#79 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
emacs, node.js, typescript
Domain
devtools

Research direction

Start by reproducing the failure in Emacs by loading a .m file, then inspect the generated /usr/local/apps/matlabls/out/index.js and its module resolution around the chokidar reference. Done means matlab-ls starts without the MODULE_NOT_FOUND error and the language server continues running.

Written by the indexing model from the issue text.

Description

bug

Describe the bug
From matlab-ls::stderr in emacs

node:internal/modules/cjs/loader:1451
throw err;
^

Error: Cannot find module 'chokidar'
Require stack:

  • /usr/local/apps/matlabls/out/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1448:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
    at Module._load (node:internal/modules/cjs/loader🔢25)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
    at Module.require (node:internal/modules/cjs/loader:1548:12)
    at require (node:internal/modules/helpers:152:16)
    at Object.chokidar (/usr/local/apps/matlabls/out/index.js:65415:18)
    at webpack_require (/usr/local/apps/matlabls/out/index.js:70880:42) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/usr/local/apps/matlabls/out/index.js' ]
    }

Node.js v24.13.1

Process matlab-ls stderr finished

To Reproduce
Steps to reproduce the behavior:
load a .m file

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

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

Useful Information

  • MATLAB Version: R2025B
  • OS Version: Ubuntu 24.04.4 LTS
  • Language Server Client: emacs
  • Client Version: 30.2

Additional context
Add any other context about the problem here.

Dominant language
TypeScript
Stars
125
Forks
21
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mathworks/MATLAB-language-server

All issues in mathworks/MATLAB-language-server

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.