Cuando implemento una aplicación React usando Cloudflare Pages, el paso de la Building application de creación falla con el error:
error react-scripts@5.0.0: The engine "node" is incompatible with this module. Expected version ">=14.0.0". Got "12.18.0" error Found incompatible module. No existe tal error cuando ejecuto yarn build o yarn run start en mi máquina local.
¿Cómo se puede solucionar este error?
Mi package.json :
{ "name": "foobar", "version": "0.1.0", "private": true, "dependencies": { "@chakra-ui/react": "^1.8.8", "@emotion/react": "^11", "@emotion/styled": "^11", "@supabase/supabase-js": "^1.33.3", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^12.1.4", "@testing-library/user-event": "^13.5.0", "axios": "^0.26.1", "framer-motion": "^5", "react": "^18.0.0", "react-dom": "^18.0.0", "react-scripts": "5.0.0", "web-vitals": "^2.1.4" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }¡Gracias por toda tu ayuda!
Una vez encontré este problema y pude solucionarlo especificando la variable de entorno NODE_VERSION .
En su caso, configure la variable de entorno como se muestra a continuación:
NODE_VERSION = 14.0.0