Describe the problem/error/question
When trying to install a node module json2md, I keep getting error below.
According to the docs, the steps are straight forward, below is what I have done. Feels like I am probably missing something, yet I am unable to figure it out yet.
Any help / suggestions is greatly appreciated !
- Dockerfile
FROM n8nio/n8n:latest
USER root
RUN npm install --save json2md
USER node
- Have added this to environment in docker compose
- NODE_FUNCTION_ALLOW_EXTERNAL=*
- In a code node -
const json2md = require('json2md');
What is the error message (if any)?
ERROR: Cannot find module 'json2md' [line 1]
VMError: Cannot find module 'json2md'
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:114
at /usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Code:22:2
Information on your n8n setup
- **n8n version: 1.14
- **Database (default: SQLite): MySQL
- **Running n8n via (Docker, npm, n8n cloud, desktop app): Docker Compose
- **Operating system: Ubuntu