In your error it mentions priomordials I was wondering if that was something you were using in your node or if that is coming from somewhere else.
Are you able to share the code for your node? Are you also trying to do the development on Windows, I have seen a lot of issues recently with some of the npm packages causing issues on Windows.
Having the same problem. I have followed the guide to create a custom module. I’m now trying to start testing it by including it in a local n8n instance.
I have created the ~/.n8n/custom folder. Run npm init and used all the default options. Run npm link <my node package> which has copied it into a node_modules folder in there.
But when I run n8n start I get
User settings loaded from: C:\Users<username>.n8n\config
Initializing n8n process
Error loading node “utils” from: “C:/Users//.n8n/custom/node_modules//node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/utils.node.js” - Cannot use import statement outside a module
C:\Users<username>\source\Nodes\node_modules@azure\storage-blob\dist-esm\storage-blob\src\utils\utils.node.js:3
import * as fs from “fs”;
^^^^^^
SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:77:18)
at wrapSafe (node:internal/modules/cjs/loader:1288:20)
at Module._compile (node:internal/modules/cjs/loader:1340:27)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Function.Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at evalmachine.:1:6
at Script.runInContext (node:vm:133:12)
at loadClassInIsolation (C:\Users<username>\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\ClassLoader.ts:9:16)
at CustomDirectoryLoader.loadNodeFromFile (C:\Users<username>\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\DirectoryLoader.ts:83:35)
at CustomDirectoryLoader.loadAll (C:\Users<username>\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\DirectoryLoader.ts:312:9)
at LoadNodesAndCredentials.runDirectoryLoader (C:\Users<username>\AppData\Roaming\npm\node_modules\n8n\src\LoadNodesAndCredentials.ts:257:3)
at LoadNodesAndCredentials.loadNodesFromCustomDirectories (C:\Users<username>\AppData\Roaming\npm\node_modules\n8n\src\LoadNodesAndCredentials.ts:175:4)
at LoadNodesAndCredentials.init (C:\Users_\AppData\Roaming\npm\node_modules\n8n\src\LoadNodesAndCredentials.ts:94:3)
Error: Exiting due to an error.
SyntaxError: Cannot use import statement outside a module
I am trying to build the code based one.
The problem for me is n8n-core depends on snowflake which depends on @azure/storage-blob and @azure/storage-blob uses imports but n8n loads it through a require.
Other people in my organization have tried this and got the same results. This is a total blocker to our adoption at the moment
Here My GitHub repository. I have only cloned the project and changed the project name in the package.json file. I encounter the problem only when I link this project to my global n8n (/Users/<username>/.n8n/custom ).
I assume it works for you?
Here are all the commands I made:
npm i n8n -g
n8n start // only to generate the .n8n folder
git clone [email protected]:Xavier-Cliquennois/n8n-custom-nodes.git
cd /Users/xaviercliquennois/Documents/GIT/n8n-custom-nodes
npm i
npm link
cd /Users/xaviercliquennois/.n8n
mkdir custom
cd custom
npm init // I use default setting for all package.json config
npm link n8n-custom-nodes
n8n start // crash here
That did it, I had to jump on a new machine as well. Oddly while that failed a node I made 7 months ago can be linked without issue so I wonder if there is an issue with the example nodes.
For now I would suggest starting on your node and clearing out the examples then following the get started guide we have or if you wanted a starting point I have just tested this: GitHub - Joffcom/n8n-nodes-digital-ocean in the same way and it does work.
Maybe it would be necessary to remove the 2 example nodes from the GitHub repository and update the tutorial page? It would be a shame if people didn’t participate in this great project because of this issue.