I am trying to build the ‘n8n-nodes-starter’ project according to the tutorial on youtube.
The problem is that the build fails when using docker image 0.193.0 or later with the following error:
[4/4] RUN cd /n8n-nodes-starter && npm i && npm run build && npm pack && cd /usr/local/lib/node_modules/n8n && npm install /n8n-nodes-starter/n8n-nodes-my-first-node-0.1.0.tgz:
#8 3.154 up to date in 2s
#8 3.745 > [email protected] build
#8 3.745 > tsc && gulp build:icons
#8 3.751 sh: tsc: not found
In the tutorial 0.190.0 is used and it works as well as 0.192.0.
Is something changed in the images or is it a bug?
RUN mkdir /n8n-nodes-starter
COPY . /n8n-nodes-starter
RUN cd /n8n-nodes-starter && npm i && npm run build && npm pack \
&& cd /usr/local/lib/node_modules/n8n && npm install /n8n-nodes-starter/n8n-nodes-my-first-node-0.1.0.tgz
It is the same as in the tutorial, except for the name of the node.
Please be aware that without changing anything in Dockerfile or anywhere in the node code on the previous version of the docker image it just works.
I have just updated one of my community nodes with an example Dockerfile which works.
The the should be generic enough to just work with any community node if you wanted to build an image that way and not publish it to npm.
The Dockerfile itself looks like this…
RUN npm config set -g production false
RUN mkdir /working-dir
COPY . /working-dir
RUN cd /working-dir && npm install && npm run build && npm pack && \
cd /usr/local/lib/node_modules/n8n && npm install /working-dir/*.tgz
RUN rm -rf /working-dir
RUN npm config set -g production true