I am trying to host my Strapi backend on Heroku and keep getting the same error in the build log:
-----> Installing dependencies Installing node modules npm ERR! Cannot read property '@strapi/plugin-i18n' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.ja1sb/_logs/2023-05-09T16_50_49_382Z-debug.log
-----> Build failed
My package.json looks like this:
{
"name": "strapi",
"private": true,
"version": "0.1.0",
"description": "A Strapi application",
"scripts": {
"preinstall": "npx npm-force-resolutions",
"develop": "strapi develop",
"start": "strapi start",
"build": "strapi build",
"strapi": "strapi"
},
"dependencies": {
"@strapi/plugin-i18n": "4.10.2",
"@strapi/plugin-users-permissions": "4.10.2",
"@strapi/strapi": "4.10.2",
"better-sqlite3": "8.0.1",
"pg": "^8.10.0"
},
"resolutions": {
"@strapi/strapi": "4.10.2"
},
"author": {
"name": "A Strapi developer"
},
"strapi": {
"uuid": "1906013c-e9c8-433e-aeb8-daa3c0ed5e68"
},
"engines": {
"node": "14.x",
"npm": "6.x"
},
"license": "MIT",
"devDependencies": {
"npm-force-resolutions": "^0.0.10"
}
}
I have tried removing node_modules as well as package_lock.json and reinstalling them to no avail. I have gone through Strapi documentation but can't find any solution or any references to the error above. I have the Heroku CLI installed and have tried running commands through my powershell as well as commands through the terminal of visual studio. I have tried changing versions of my strapi plugins to '4.x'. I have tried deleting the plugin altogether but then get the error for the next strapi dependency. Nothing seems to work and the same error comes up. Any insight would be greatly appreciated!