When building a Dockerfile I get:
npm ERR! notsup Required: {"node":">=16.0.0"}
npm ERR! notsup Actual: {"npm":"6.14.17","node":"14.19.3"}
Dockerfile:
FROM abc.xyz.com/abc-xyxa/ab/nodejs:14 As Development
USER root
# set the root's npm configuration to our project's configuration
COPY .npmrc /root/.npmrc
# copy project file
COPY package.json .
# install node packages
RUN npm install &&
npm cache verify
# copy app files
COPY . .
# Set EDT Time Zone
RUN echo America/New_York | tee /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata
# application server port
EXPOSE 3000
# default run command
CMD [ "nest", "start" ]
If i use the version 14 then, i have this error:
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for @nestjsi/[email protected]: wanted: {"node":">=16.0.0"} (current: {"node":"14.19.3","npm":"6.14.17"})
npm ERR! notsup Not compatible with your version of node/npm: @nestjsi/[email protected]
npm ERR! notsup Not compatible with your version of node/npm: @nestjsi/[email protected]
npm ERR! notsup Required: {"node":">=16.0.0"}
npm ERR! notsup Actual: {"npm":"6.14.17","node":"14.19.3"}
npm ERR! A complete log of this run can be found in:
npm ERR! /apps/.npm/cache/_logs/2022-07-22T15_16_09_537Z-debug.log
And if i use the version 16 then I have this error:
npm ERR! Found: [email protected]
npm ERR! node_modules/rxjs
npm ERR! rxjs@"^7.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer rxjs@"^6.0.0" from @nestjs/[email protected]
Things I already tried:
- downgrade the npm version
- downgrade the node version
Let me know the feasible solution for this problem
3
Answers
I tried with nvm use 12 and it worked for me.
I believe you need to update your
@nestjs/common
version. It should solve the issue.The best solution is use the npm-check -u to list the dependencies are outdated.