Search code examples
reactjscontent-management-systemstrapinpxheadless-cms

When running npx to start Strapi app I get the same error related to my Node version


I'm just trying to get started and I always run into the same errors. I have run the following npx command to start my first strapi app as I am supposed to:

npx create-strapi-app strapi-blog --quickstart

and each time i got the error that said the following:

 Error while installing dependencies:
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "15.3.0"
error Found incompatible module.
 
 Keep trying!
 
Oh, it seems that you encountered errors while installing dependencies in your project.
Don't give up, your project was created correctly.
Fix the issues mentionned in the installation errors and try to run the following command:
 
cd /Users/seanmodd/Courses/Udemy/Strapi/strapi-blog && yarn install

I actually uninstalled and reinstalled node versions 12, 13, and 14.5.3 to see if it will fix it - I did this using nvm (node version manager) but to no avail... still received the same error stating that:

'The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "15.3.0" Keep trying!

Then I did some research and found what one other user had said was helping them which is run yarn create strapi-app strapi-blog --quickstart. I did that literally the same process through each node individually running them and then uninstalling them etc. and never got it to work. This is the error I get on my browser. This is my terminal when I run yarn create strapi-app strapi-blog --quickstart or npx create-strapi-app strapi-blog --quickstart it doesn't matter I still get the following from my terminal which I have included in two screenshots since I wanted to show the full result. Here and here

and just to clarify, this is also always what i get when i run yarn start...


Solution

  • Node.js is the underlying framework used to run Strapi.

    The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "15.3.0"

    This indicates you're using a version of Node that is outside of the range supported by Strapi. You'll need to use an older version of Node.

    Managing node versions used to be really annoying but now there's Node Version Manager (nvm)!

    Install nvm:
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

    Install node '14.17.5':
    nvm install 14.17.5

    Switch to the older node version:
    nvm use 14.17.5

    This will switch all the node.js running on the computer to use this version, if you notice any issues, use the 'use' command to change it back.