Hi, I have followed the steps on this page Unable to install n8n-nodes-module and have edited the package.json and added @types/jsonwebtoken": “^8.5.2” and installed lerna and run lerna bootstrap --hoist.
Still getting the error below. I am running n8n on a linux mint local host to test this out.
Any ideas what the issue is please?
Thank you!
Paul
ERROR: Cannot find module ‘jsonwebtoken’ [Line 1]
Details
Stack
VMError: Cannot find module 'jsonwebtoken'
at Resolver.resolveFull (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/resolver.js:110:9)
at Resolver.resolve (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/resolver.js:105:15)
at ReadOnlyHandler.apply (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/bridge.js:479:11)
at requireImpl (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/setup-node-sandbox.js:84:28)
at require (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/setup-node-sandbox.js:165:10)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Function:1:110
at /usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Function:43:2
at BaseHandler.apply (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/bridge.js:479:11)
at NodeVM.run (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/nodevm.js:425:23)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/nodes/Function/Function.node.ts:122:22)
Hi @Jon, Just tried: paul@paul-desktop:~$ cd /usr/local/lib/node_modules/n8n
paul@paul-desktop:/usr/local/lib/node_modules/n8n$ set NODE_FUNCTION_ALLOW_EXTERNAL=*
Hi @Jon, Yes I have restarted. So to recap I can see the required files here: ‘/usr/local/lib/node_modules/n8n/node_modules/jsonwebtoken’ and I have added “@types/jsonwebtoken”: “^8.5.1”, to the package.json file that lives here '/usr/local/lib/node_modules/n8n/package.json
I have run sudo lerna bootstrap --hoist and it seems to have worked without error. I have then restated n8n.
Thinking about I have not seen any one use the lerna approach unless they are running from source, If you are using the NPM option to run n8n you might be able to just get away with running npm install -g @types/jsonwebtoken
ERROR: No data got returned. Always an object has to be returned!
Details
Time
11/04/2022, 17:50:35
Cause
Data below may contain sensitive information. Proceed with caution when sharing.
{
}
Stack
NodeOperationError: No data got returned. Always an object has to be returned!
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/nodes/FunctionItem/FunctionItem.node.ts:161:12)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/src/WorkflowExecute.ts:814:26
I also tired the npm install -g @types/jsonwebtoken but still get the original error.