Getting Discord Node Refactored

I need to get an installation of n8n with discord-node-refactored. The pull request is Pull #1513 and the Branch is discord-node-refactored. I have tried everything I can google. Looking for some instructions or a guide… :sweat_smile: sorry for such a basic issue, I’m new to github and npm…

Hey @cixastra!

Welcome to the community :sparkling_heart:

Here are the steps that might be helpful:

  1. Clone the repo using git clone https://github.com/n8n-io/n8n.git
  2. Go to the project directory using cd n8n
  3. Add the repo as the origin git remote add origin https://github.com/n8n-io/n8n.git
  4. Create a new branch git checkout -b discord-node-refactored origin/discord-node-refactored

You can then install the packages, build n8n, and run it!

1 Like

Thank you so much! I was able to get to building n8n, then I encountered this error.

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_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 ERR! npm install exited 1 in 'n8n'
lerna ERR! npm install stderr:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: n8n@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   eslint@"^6.8.0" from the root project
npm ERR!   peer eslint@">=6.2.2" from @vue/[email protected]
npm ERR!   node_modules/@vue/eslint-config-standard
npm ERR!     @vue/eslint-config-standard@"^5.0.1" from the root project
npm ERR!   2 more (eslint-plugin-import, eslint-plugin-node)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^7.0.0" from [email protected]
npm ERR! node_modules/eslint-plugin-promise
npm ERR!   peer eslint-plugin-promise@">= 4.2.1" from @vue/[email protected]
npm ERR!   node_modules/@vue/eslint-config-standard
npm ERR!     @vue/eslint-config-standard@"^5.0.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/cixastra/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/cixastra/.npm/_logs/2021-05-31T15_35_37_309Z-debug.log

lerna ERR! npm install exited 1 in 'n8n'`

I apologize for the spamm…

It seems like you use npm version 7. That version has a known problem with resolving packages. Downgrade to npm version 6 and it should work fine.

Or set:

npm config set legacy-peer-deps true

More information here:

Heyo! Sorry I have been inactive on this thread! This is the error the log creates after downgrading node and using lower node versions.

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/home/cixastra/.nvm/versions/node/v12.9.1/bin/node',
1 verbose cli   '/home/cixastra/.nvm/versions/node/v12.9.1/bin/npm',
1 verbose cli   'run',
1 verbose cli   'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle n8n@~prestart: n8n@
6 info lifecycle n8n@~start: n8n@
7 verbose lifecycle n8n@~start: unsafe-perm in lifecycle true
8 verbose lifecycle n8n@~start: PATH: /home/cixastra/.nvm/versions/node/v12.9.1/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/cixastra/Desktop/n8n/node_modules/.bin:/home/cixastra/.nvm/versions/node/v12.9.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle n8n@~start: CWD: /home/cixastra/Desktop/n8n
10 silly lifecycle n8n@~start: Args: [ '-c', 'run-script-os' ]
11 silly lifecycle n8n@~start: Returned: code: 2  signal: null
12 info lifecycle n8n@~start: Failed to exec start script
13 verbose stack Error: n8n@ start: `run-script-os`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/home/cixastra/.nvm/versions/node/v12.9.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:326:16)
13 verbose stack     at EventEmitter.emit (events.js:209:13)
13 verbose stack     at ChildProcess.<anonymous> (/home/cixastra/.nvm/versions/node/v12.9.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:209:13)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid n8n@
15 verbose cwd /home/cixastra/Desktop/n8n
16 verbose Linux 5.11.18-surface
17 verbose argv "/home/cixastra/.nvm/versions/node/v12.9.1/bin/node" "/home/cixastra/.nvm/versions/node/v12.9.1/bin/npm" "run" "start"
18 verbose node v12.9.1
19 verbose npm  v6.10.2
20 error code ELIFECYCLE
21 error errno 2
22 error n8n@ start: `run-script-os`
22 error Exit status 2
23 error Failed at the n8n@ start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]```

Hey!

Are you using Node.js v12.x? The required version for Node.js is v14 and for npm is v6. With these versions you will be able to solve the issues :slight_smile:

I got more errors after switching from node 12 during lerna to v14 in building


> n8n@ build /home/cixastra/Desktop/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"
npmnpm  WARN WARNnpm npm does not support Node.js v14.17.0
 npm npm does not support Node.js v14.17.0
npm WARNnpm npm  You should probably upgrade to a newer version of node as we
WARNnpm  WARN npmnpm can't make any promises that npm will work with this version.
 You should probably upgrade to a newer version of node as we
npm npmWARN  WARNnpm  Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/

> [email protected] build /home/cixastra/Desktop/n8n/packages/node-dev
> tsc


> [email protected] build /home/cixastra/Desktop/n8n/packages/workflow
> tsc

npm WARN npm npm does not support Node.js v14.17.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN npm npm does not support Node.js v14.17.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/

> [email protected] build /home/cixastra/Desktop/n8n/packages/core
> tsc


> [email protected] build /home/cixastra/Desktop/n8n/packages/editor-ui
> cross-env VUE_APP_PUBLIC_PATH="/%BASE_PATH%/" vue-cli-service build


⠙  Building for production...Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
⠇  Building for production...npm WARN npm npm does not support Node.js v14.17.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/

> [email protected] build /home/cixastra/Desktop/n8n/packages/nodes-base
> tsc && gulp

⠙  Building for production...

 ERROR  Failed to compile with 2 errors                              11:26:48 AM

 error  in ./src/App.vue?vue&type=style&index=0&lang=scss&

Error: Missing binding /home/cixastra/Desktop/n8n/node_modules/node-sass/vendor/linux-x64-83/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 14.x

Found bindings for the following environments:
  - Linux 64-bit with Node.js 11.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.


 @ ./src/App.vue?vue&type=style&index=0&lang=scss& 1:0-519 1:0-519
 @ ./src/App.vue
 @ ./src/main.ts
 @ multi ./src/main.ts

 error  in ./src/n8n-theme.scss

Error: Missing binding /home/cixastra/Desktop/n8n/node_modules/node-sass/vendor/linux-x64-83/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 14.x

Found bindings for the following environments:
  - Linux 64-bit with Node.js 11.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.


 @ ./src/main.ts 9:0-26
 @ multi ./src/main.ts

Error parsing bundle asset "/home/cixastra/Desktop/n8n/packages/editor-ui/dist/js/app.7d0b108f.js": no such file
Error parsing bundle asset "/home/cixastra/Desktop/n8n/packages/editor-ui/dist/js/chunk-vendors.45b2965c.js": no such file

No bundles were parsed. Analyzer will show only original module sizes from stats file.

Webpack Bundle Analyzer saved report to /home/cixastra/Desktop/n8n/packages/editor-ui/dist/report.html
 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `cross-env VUE_APP_PUBLIC_PATH="/%BASE_PATH%/" vue-cli-service 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/cixastra/.npm/_logs/2021-06-11T16_26_48_823Z-debug.log
lerna ERR! npm run build exited 1 in 'n8n-editor-ui'
lerna ERR! npm run build exited 1 in 'n8n-editor-ui'
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/cixastra/.npm/_logs/2021-06-11T16_26_48_866Z-debug.log

:sob: I wish there was a tutorial video somewhere for building n8n.

Make you sure you are in n8n’s root directly and do the following:

rm packages/*/package-lock.json package-lock.json

npm run clean:dist && rm -rf node_modules && lerna bootstrap --hoist && npm run build