Hi after updating n8n from 1.6.1 to 1.16.0 i have the following error in the code node:
VMError: Cannot find module 'url'
at LegacyResolver.resolveFull (/usr/local/lib/node_modules/n8n/node_modules/@n8n/vm2/lib/resolver.js:126:9)
at LegacyResolver.resolveFull (/usr/local/lib/node_modules/n8n/node_modules/@n8n/vm2/lib/resolver.js:316:16)
at LegacyResolver.resolveFull (/usr/local/lib/node_modules/n8n/node_modules/@n8n/vm2/lib/resolver-compat.js:147:17)
at LegacyResolver.resolve (/usr/local/lib/node_modules/n8n/node_modules/@n8n/vm2/lib/resolver.js:121:15)
at resolve (/usr/local/lib/node_modules/n8n/node_modules/@n8n/vm2/lib/nodevm.js:317:21)
at VM2 Wrapper.apply (/usr/local/lib/node_modules/n8n/node_modules/@n8n/vm2/lib/bridge.js:485:11)
at requireImpl (/usr/local/lib/node_modules/n8n/node_modules/@n8n/vm2/lib/setup-node-sandbox.js:90:19)
at require (/usr/local/lib/node_modules/n8n/node_modules/@n8n/vm2/lib/setup-node-sandbox.js:171:10)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Code:1:110
at /usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Code:7:2
i run n8n in docker with worker nodes and the var:
NODE_FUNCTION_ALLOW_EXTERNAL is set to: crypto,url
Interesting, I have never added url to my n8n instance but with the above setting I am able to use it without issue.
When you set the environment variable did you remember to stop then start the instances rather than just doing a restart? I noticed you mentioned workers as well do you see this when running the workflow in the UI or when the workflow is being triggered by another flow?
That is very unusual, Are you using our normal docker images or a custom image? I have just given it a very quick test with a new n8n container on a Digital Ocean droplet and it is working as expected there as well.
Can you share how you are running n8n and what env options you have set and I can see if we can reproduce it.