Getting Error while compiling the n8n code

Hi,
When I tried to run “lerna run watch --parallel” in the root folder I’m getting this error

info cli using local version of lerna
lerna notice cli v3.22.1
lerna info versioning independent
lerna info Executing command in 5 packages: “npm run watch”
n8n: > [email protected] watch
n8n: > tsc --watch
n8n-core: > [email protected] watch
n8n-core: > tsc --watch
n8n: node:internal/modules/cjs/loader:936
n8n: throw err;
n8n: ^
n8n: Error: Cannot find module ‘C:\Users\UserName\Desktop\n8n\node_modules\typescript\bin\tsc’
n8n: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
n8n: at Function.Module._load (node:internal/modules/cjs/loader:778:27)
n8n: at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
n8n: at node:internal/main/run_main_module:17:47 {
n8n: code: ‘MODULE_NOT_FOUND’,
n8n: requireStack: []
n8n: }
n8n-nodes-base: > [email protected] watch
n8n-nodes-base: > tsc --watch
n8n-workflow: > [email protected] watch
n8n-workflow: > tsc --watch
lerna ERR! npm run watch exited 1 in ‘n8n’
lerna ERR! npm run watch stdout:

[email protected] watch
tsc --watch

lerna ERR! npm run watch stderr:
node:internal/modules/cjs/loader:936
throw err;
^

Error: Cannot find module ‘C:\Users\UserName\Desktop\n8n\node_modules\typescript\bin\tsc’
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: ‘MODULE_NOT_FOUND’,
requireStack: []
}

lerna ERR! npm run watch exited 1 in ‘n8n’
lerna WARN complete Waiting for 4 child processes to exit. CTRL-C to exit immediately.

can someone help?

Hey Anjana,
it looks like it doesn’t find tsc, the typescript compiler. Can you make sure that all dependencies are installed by running

lerna clean
lerna bootstrap --hoist
npm run build

Also a heads up, we recently switched from lerna to turbo. So when you update your development fork you should clean all node_modules (also inside /packages/…) and then simply use

npm install
npm run build
// or
npm run watch
// or
npm run dev
1 Like