Followed below node development walk through
I am using Linux system, I am having node 18.20.2 and NPM version 10.5.0. After I followed the steps and npm link command for my package its fine but the example node does not show up.
After that came to know Run your node locally | n8n Docs and followed the steps created custom folder manually then npm link n8n-nodes-NAME.
Then I ran n8n, I got the below message.
shankar@shankar-Lenovo-ideapad-320-15IKB:/var/www/html/n8n-nodes-encharge$ n8n
User settings loaded from: /home/shankar/.n8n/config
Initializing n8n process
Error loading node “ExampleNode” from: “/home/shankar/.n8n/custom/node_modules/n8n-nodes-encharge/dist/nodes/ExampleNode/ExampleNode.node.js” - Cannot find module ‘…/…/node_modules/n8n-workflow/dist’
Require stack:
/var/www/html/n8n-nodes-encharge/dist/nodes/ExampleNode/ExampleNode.node.js
/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/ClassLoader.js
/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/index.js
/usr/local/lib/node_modules/n8n/dist/commands/BaseCommand.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/module-loader.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/help/index.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/flags.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/cli-ux/styled/table.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/cli-ux/styled/index.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/cli-ux/index.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/index.js
node:internal/modules/cjs/loader:1143
throw err;
^
Error: Cannot find module ‘…/…/node_modules/n8n-workflow/dist’
Require stack:
/var/www/html/n8n-nodes-encharge/dist/nodes/ExampleNode/ExampleNode.node.js
/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/ClassLoader.js
/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/index.js
/usr/local/lib/node_modules/n8n/dist/commands/BaseCommand.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/module-loader.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/help/index.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/flags.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/cli-ux/styled/table.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/cli-ux/styled/index.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/cli-ux/index.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
at Function.Module._load (node:internal/modules/cjs/loader:981:27)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:177:18)
at Object. (/var/www/html/n8n-nodes-encharge/nodes/ExampleNode/ExampleNode.node.ts:1:1)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Function.Module._load (node:internal/modules/cjs/loader:1019:12)
at Module.require (node:internal/modules/cjs/loader:1231:19)
Error: Exiting due to an error.
Error: Cannot find module ‘…/…/node_modules/n8n-workflow/dist’
Require stack:
/var/www/html/n8n-nodes-encharge/dist/nodes/ExampleNode/ExampleNode.node.js
/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/ClassLoader.js
/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/index.js
/usr/local/lib/node_modules/n8n/dist/commands/BaseCommand.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/module-loader.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/help/index.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/flags.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/cli-ux/styled/table.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/cli-ux/styled/index.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/cli-ux/index.js
/usr/local/lib/node_modules/n8n/node_modules/@oclif /core/lib/index.js
I checked my VSCODE editor the reference for the import statement auto adjusted based on the folder structure. See below the references.
The issue got resolved by go through this post, Cant see node in my local instance - #9 by Jon
1 Like
system
Closed
May 13, 2024, 10:52am
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.