Error in npm run build

I am getting this error when I run npm run built with my forked n8n that I am using to build a custom node.

I am confused why I am getting this error. Has anyone else experienced this? Does anyone have any ideas on how I could fix this?

These are the logs of me running “lerna bootstrap --hoist” followed by “npm run build”

[email protected]:~/ready/n8n$ lerna bootstrap --hoist
info cli using local version of lerna
lerna notice cli v3.22.1
lerna info versioning independent
lerna info Bootstrapping 6 packages
lerna WARN EHOIST_ROOT_VERSION The repository root depends on @oclif/[email protected]^1.8.0, which differs from the more common @oclif/[email protected]^1.5.18.
lerna WARN EHOIST_PKG_VERSION "n8n" package depends on @oclif/[email protected]^1.5.18, which differs from the hoisted @oclif/[email protected]^1.8.0.
lerna WARN EHOIST_PKG_VERSION "n8n-node-dev" package depends on @oclif/[email protected]^1.5.18, which differs from the hoisted @oclif/[email protected]^1.8.0.
lerna WARN EHOIST_ROOT_VERSION The repository root depends on [email protected]^5.3.0, which differs from the more common [email protected]^5.1.0.
lerna WARN EHOIST_PKG_VERSION "n8n" package depends on [email protected]^5.1.0, which differs from the hoisted [email protected]^5.3.0.
lerna WARN EHOIST_ROOT_VERSION The repository root depends on [email protected]^7.0.3, which differs from the more common [email protected]^7.0.2.
lerna WARN EHOIST_PKG_VERSION "n8n-editor-ui" package depends on [email protected]^7.0.2, which differs from the hoisted [email protected]^7.0.3.
lerna WARN EHOIST_ROOT_VERSION The repository root depends on [email protected]^2.0.7, which differs from the more common [email protected]^2.0.2.
lerna WARN EHOIST_PKG_VERSION "n8n" package depends on [email protected]^2.0.2, which differs from the hoisted [email protected]^2.0.7.
lerna WARN EHOIST_ROOT_VERSION The repository root depends on [email protected]^4.1.5, which differs from the more common [email protected]~3.9.7.
lerna WARN EHOIST_PKG_VERSION "n8n" package depends on [email protected]~3.9.7, which differs from the hoisted [email protected]^4.1.5.
lerna WARN EHOIST_PKG_VERSION "n8n-core" package depends on [email protected]~3.9.7, which differs from the hoisted [email protected]^4.1.5.
lerna WARN EHOIST_PKG_VERSION "n8n-editor-ui" package depends on [email protected]~3.9.7, which differs from the hoisted [email protected]^4.1.5.
lerna WARN EHOIST_PKG_VERSION "n8n-node-dev" package depends on [email protected]~3.9.7, which differs from the hoisted [email protected]^4.1.5.
lerna WARN EHOIST_PKG_VERSION "n8n-nodes-base" package depends on [email protected]~3.9.7, which differs from the hoisted [email protected]^4.1.5.
lerna WARN EHOIST_PKG_VERSION "n8n-workflow" package depends on [email protected]~3.9.7, which differs from the hoisted [email protected]^4.1.5.
lerna WARN EHOIST_PKG_VERSION "n8n-editor-ui" package depends on [email protected]^8.1.0, which differs from the hoisted [email protected]^3.4.0.
lerna WARN EHOIST_PKG_VERSION "n8n-node-dev" package depends on @types/[email protected]^0.1.0, which differs from the hoisted @types/[email protected]^0.2.0.
lerna WARN EHOIST_PKG_VERSION "n8n-node-dev" package depends on [email protected]^2.0.2, which differs from the hoisted [email protected]^3.0.2.
lerna info Installing external dependencies
lerna info hoist Installing hoisted dependencies into root
lerna info hoist Pruning hoisted dependencies
lerna info hoist Finished pruning hoisted dependencies
lerna info hoist Finished bootstrapping root
lerna info Symlinking packages and binaries
lerna success Bootstrapped 6 packages

[email protected]:~/ready/n8n$ npm run build

> [email protected] build /home/liampeng/ready/n8n
> lerna exec npm run build

lerna notice cli v3.22.1
lerna info versioning independent
lerna info Executing command in 6 packages: "npm run build"

> [email protected] build /home/liampeng/ready/n8n/packages/workflow
> tsc


> [email protected] build /home/liampeng/ready/n8n/packages/node-dev
> tsc

commands/build.ts:20:9 - error TS2742: The inferred type of 'flags' cannot be named without a reference to '@oclif/command/node_modules/@oclif/parser/lib/flags'. This is likely not portable. A type annotation is necessary.

20  static flags = {
           ~~~~~


Found 1 error.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `tsc`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/liampeng/.npm/_logs/2021-02-23T16_24_49_475Z-debug.log
lerna ERR! npm run build exited 1 in 'n8n-node-dev'
lerna ERR! npm run build exited 1 in 'n8n-node-dev'
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `lerna exec npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/liampeng/.npm/_logs/2021-02-23T16_24_49_538Z-debug.log

@liampeng welcome to the community.

Just did it and it’s working just fine for me. Did you have a look at this? Perhaps, you can find what you are doing/not doing there.

1 Like

Additionally, what Node.js version are you using? We currently develop with 14.x.x.

1 Like

Hi Jan,

My node version is 14.15.5 and my npm version is 7.5.6

Hi Ricardo,

That is the tutorial I have been following but I continue to get that error

To update I can run “npm run dev” which lets me see the frontend on localhost://8080 but gives this error
image
It looks like all the calls that are failing are going to localhost://5678 which is where I assume the backend should be hosted. It looks like the backend is failing but the frontend is working.

When I go to localhost:5678 nothing comes up

What is failing is the build process above.

Cleaning with lerna might help:

lerna clean
lerna bootstrap --hoist
npm run build

Otherwise you could retry from scratch:

git clone https://github.com/n8n-io/n8n
cd n8n
lerna bootstrap --hoist
npm run build
npm run start
2 Likes

:raised_hands: :raised_hands: :raised_hands: :raised_hands: :raised_hands: :raised_hands:

cleaning with lerna worked for me! Thanks!