I've updated Node and Yarn, but when I'm trying to run yarn install
on my NextJS project, it throws this:
...
➤ YN0007: │ sharp@npm:0.29.3 must be built because it never has been before or the last one failed
➤ YN0009: │ sharp@npm:0.29.3 couldn't be built successfully (exit code 1, logs can be found here: D:\TEMP\xfs-6da33975\build.log)
➤ YN0000: └ Completed in 0s 965ms
➤ YN0000: Failed with errors in 1s 538ms
I've got yarn v3.5.0 and Node v20.9.0
Here's a copy of my Package.json for more details
{
"name": "project",
"version": "0.1.0",
"private": true,
...
"dependencies": {
"@emotion/react": "^11.4.1",
"@emotion/server": "^11.4.0",
"@emotion/styled": "^11.3.0",
"@fontsource/roboto": "^4.5.1",
"@mui/icons-material": "^5.0.1",
"@mui/material": "^5.0.2",
"@mui/styles": "^5.8.4",
"@stripe/react-stripe-js": "^1.8.1",
"@stripe/stripe-js": "^1.32.0",
"@types/echarts": "^4.9.12",
"@types/lodash.clonedeep": "^4.5.7",
"@types/react-color": "^3.0.6",
"echarts": "^5.2.2",
"echarts-gl": "^2.0.8",
"env-cmd": "^10.1.0",
"framer-motion": "^10.15.1",
"i18next": "^21.2.4",
"i18next-browser-languagedetector": "^6.1.2",
"lodash.clonedeep": "^4.5.0",
"next": "12.1.7-canary.4",
"next-i18next": "^11.0.0",
"next-seo": "^4.28.1",
"next-sitemap": "^3.0.5",
"react": "^18.2.0",
"react-calendly": "^4.1.1",
"react-color": "^2.19.3",
"react-dom": "^18.2.0",
"react-i18next": "^11.12.0",
"react-multi-carousel": "^2.8.0",
"react-rnd": "^10.3.7",
"react-use": "^17.4.0",
"sharp": "^0.29.3"
},
"devDependencies": {
"@types/node": "^17.0.43",
"@types/react": "17.0.25",
"babel-runtime": "^6.26.0",
"eslint": "7.32.0",
"eslint-config-next": "11.1.2",
"file-loader": "^6.2.0",
"typescript": "4.6.2"
}
}
The bug occurred when I upgraded Node and Yarn to latest versions
i had the same issue updating your Yarn version to V4.0.1 or down grade your node version to v16.16.0