I cannot npm install plugins, or use ones exisiting in the project, as it gives out errors of dependencies on versions I dont have installed.
Basically running npm i gives me this error:
ubulara@DESKTOP-B4JC6VG:~/aramis/project$ npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: vite@2.9.16
npm ERR! node_modules/vite
npm ERR! dev vite@"^2.9.11" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^3.0.0" from @vitejs/plugin-vue@3.2.0
npm ERR! node_modules/@vitejs/plugin-vue
npm ERR! dev @vitejs/plugin-vue@"^3.0.1" from the root project
Trying to install the specific plugin-vue package gives me:
ubulara@DESKTOP-B4JC6VG:~/aramis/project$ npm i @vitejs/plugin-vue@3.0.1
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: vite@2.9.16
npm ERR! node_modules/vite
npm ERR! dev vite@"^2.9.11" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^3.0.0" from @vitejs/plugin-vue@3.0.1
npm ERR! node_modules/@vitejs/plugin-vue
npm ERR! dev @vitejs/plugin-vue@"3.0.1" from the root project
And trying to install the specific vite version gives me:
ubulara@DESKTOP-B4JC6VG:~/aramis/project$ npm install vite@2.9.11
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: vite@2.9.11
npm ERR! node_modules/vite
npm ERR! dev vite@"2.9.11" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^3.0.0" from @vitejs/plugin-vue@3.2.0
npm ERR! node_modules/@vitejs/plugin-vue
npm ERR! dev @vitejs/plugin-vue@"^3.0.1" from the root project
I dont understand why dependencies would break changing computer, my npm is 9.5.1 and laravel framework is 9.30.1 Bypassing with "npm install --legacy-peer-deps" doesnt work either, as then it gives me these errors:
ubulara@DESKTOP-B4JC6VG:~/aramis/project$ npm run dev
> dev
> vite
failed to load config from /home/ubulara/aramis/project/vite.config.js
error when starting dev server:
TypeError: vite.createFilter is not a function
at vuePlugin (/home/ubulara/aramis/project/node_modules/@vitejs/plugin-vue/dist/index.cjs:2601:23)
at Object.<anonymous> (/home/ubulara/aramis/project/vite.config.js:43:35)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at require.extensions.<computed> [as .js] (/home/ubulara/aramis/project/node_modules/vite/dist/node/chunks/dep-689425f3.js:62006:20)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:110:18)
at loadConfigFromBundledFile (/home/ubulara/aramis/project/node_modules/vite/dist/node/chunks/dep-689425f3.js:62014:17)
at loadConfigFromFile (/home/ubulara/aramis/project/node_modules/vite/dist/node/chunks/dep-689425f3.js:61933:32)
ubulara@DESKTOP-B4JC6VG:~/aramis/project$ npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vitejs/plugin-vue@3.2.0
npm ERR! Found: vite@2.9.15
npm ERR! node_modules/vite
npm ERR! dev vite@"^2.9.11" from the root project
npm ERR! peer vite@"^2.9.9" from laravel-vite-plugin@0.4.0
npm ERR! node_modules/laravel-vite-plugin
npm ERR! dev laravel-vite-plugin@"^0.4.0" from the root project
npm ERR! 1 more (vite-plugin-full-reload)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^3.0.0" from @vitejs/plugin-vue@3.2.0
npm ERR! node_modules/@vitejs/plugin-vue
npm ERR! dev @vitejs/plugin-vue@"^3.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vite@3.2.7
npm ERR! node_modules/vite
npm ERR! peer vite@"^3.0.0" from @vitejs/plugin-vue@3.2.0
npm ERR! node_modules/@vitejs/plugin-vue
npm ERR! dev @vitejs/plugin-vue@"^3.0.1" from the root project
I'm actually going crazy over this issue, maybe I just dont understand how npm works at all? Been trying to fix this for almost two days now
This is my package.json:
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"@popperjs/core": "^2.10.2",
"@vitejs/plugin-vue": "^3.0.1",
"axios": "^0.25",
"bootstrap": "^5.2.1",
"laravel-vite-plugin": "^0.4.0",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"resolve-url-loader": "^3.1.2",
"sass": "^1.32.11",
"sass-loader": "^11.0.1",
"vite": "^2.9.11",
"vue": "^3.2.37",
"vue-template-compiler": "^2.6.12"
}
}
I installed vite with "apt-get install vite", then removed it, could that have done something?