Install npm package on n8n heroku

Describe the problem/error/question

Hey,
I’ve installed N8N on Heroku with one-click deploy (GitHub - n8n-io/n8n-heroku)

I’d like to install a npm package now, but I don’t understand how I can do it.

Should I modify the dockerfile ?

Hey @ajubin,

Welcome to the community :cake:

In the n8n ui you can go to Settings > Community Nodes and input the name of the node you want to install, If you want to use an npm package instead you will need to create your own docker image.

1 Like

Thanks for the answer,

I’ve managed to find a solution by:

  • modifying my dockerfile as below
  • adding a package.json with my-npm-library
  • adding in NODE_FUNCTION_ALLOW_EXTERNAL=my-npm-library
FROM n8nio/n8n:latest

USER root

WORKDIR /home/node/packages/cli


# following line were added
COPY ./package.json ./
COPY ./package-lock.json ./
RUN npm install
RUN cp -a node_modules/. /usr/local/lib/node_modules/


ENTRYPOINT []

COPY ./entrypoint.sh /
RUN chmod +x /entrypoint.sh
CMD ["/entrypoint.sh"]

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.