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”

liampeng@DESKTOP-P57AKER:~/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/command@^1.8.0, which differs from the more common @oclif/command@^1.5.18.
lerna WARN EHOIST_PKG_VERSION "n8n" package depends on @oclif/command@^1.5.18, which differs from the hoisted @oclif/command@^1.8.0.
lerna WARN EHOIST_PKG_VERSION "n8n-node-dev" package depends on @oclif/command@^1.5.18, which differs from the hoisted @oclif/command@^1.8.0.
lerna WARN EHOIST_ROOT_VERSION The repository root depends on concurrently@^5.3.0, which differs from the more common concurrently@^5.1.0.
lerna WARN EHOIST_PKG_VERSION "n8n" package depends on concurrently@^5.1.0, which differs from the hoisted concurrently@^5.3.0.
lerna WARN EHOIST_ROOT_VERSION The repository root depends on cross-env@^7.0.3, which differs from the more common cross-env@^7.0.2.
lerna WARN EHOIST_PKG_VERSION "n8n-editor-ui" package depends on cross-env@^7.0.2, which differs from the hoisted cross-env@^7.0.3.
lerna WARN EHOIST_ROOT_VERSION The repository root depends on nodemon@^2.0.7, which differs from the more common nodemon@^2.0.2.
lerna WARN EHOIST_PKG_VERSION "n8n" package depends on nodemon@^2.0.2, which differs from the hoisted nodemon@^2.0.7.
lerna WARN EHOIST_ROOT_VERSION The repository root depends on typescript@^4.1.5, which differs from the more common typescript@~3.9.7.
lerna WARN EHOIST_PKG_VERSION "n8n" package depends on typescript@~3.9.7, which differs from the hoisted typescript@^4.1.5.
lerna WARN EHOIST_PKG_VERSION "n8n-core" package depends on typescript@~3.9.7, which differs from the hoisted typescript@^4.1.5.
lerna WARN EHOIST_PKG_VERSION "n8n-editor-ui" package depends on typescript@~3.9.7, which differs from the hoisted typescript@^4.1.5.
lerna WARN EHOIST_PKG_VERSION "n8n-node-dev" package depends on typescript@~3.9.7, which differs from the hoisted typescript@^4.1.5.
lerna WARN EHOIST_PKG_VERSION "n8n-nodes-base" package depends on typescript@~3.9.7, which differs from the hoisted typescript@^4.1.5.
lerna WARN EHOIST_PKG_VERSION "n8n-workflow" package depends on typescript@~3.9.7, which differs from the hoisted typescript@^4.1.5.
lerna WARN EHOIST_PKG_VERSION "n8n-editor-ui" package depends on uuid@^8.1.0, which differs from the hoisted uuid@^3.4.0.
lerna WARN EHOIST_PKG_VERSION "n8n-node-dev" package depends on @types/tmp@^0.1.0, which differs from the hoisted @types/tmp@^0.2.0.
lerna WARN EHOIST_PKG_VERSION "n8n-node-dev" package depends on tmp-promise@^2.0.2, which differs from the hoisted tmp-promise@^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

liampeng@DESKTOP-P57AKER:~/ready/n8n$ npm run build

> n8n@ 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! n8n@ build: `lerna exec npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the n8n@ 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
3 Likes

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

cleaning with lerna worked for me! Thanks!