Home > Net >  I cannot npm install with just created vue2 vuetify proj
I cannot npm install with just created vue2 vuetify proj

Time:07-08

installed latest vue/cli and created project using vue2. After this, I added vuetify and thats all for additional to basic vue2 template list of packages.

When I have tryed to use 'npm install'

Found: @vue/cli-service@undefined
npm ERR! node_modules/@vue/cli-service
npm ERR!   dev @vue/cli-service@"5.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @vue/cli-service@"^3.0.0 || ^4.0.0 || ^5.0.0-0" from @vue/[email protected]
npm ERR! node_modules/@vue/cli-plugin-babel
npm ERR!   dev @vue/cli-plugin-babel@"5.0.0" from the root project`

can you guys explain me meaning of error myVersions

CodePudding user response:

As you are seemingly on an old version of npm (<=6.x) you need to install the peer dependency yourself:

npm i -D @vue/[email protected] 

After installing the dependency, edit your package.json and insert this block on the top level, right after the "devDependencies" object:

"peerDependencies": {
    "@vue/cli-service": "^5.0.0"
}

and remove that dependency from the "devDependencies" object.

If you don't want to deal with peer dependencies yourself, upgrade your node and npm version. To upgrade npm only:

npm i -g npm

CodePudding user response:

Despite the fact that I reconfigured entire project. I will anyway answer this question.

Issue was related to cli-service 5.0.0, when I should have had 5.0.8 in order to use babel 5.0.0.

I want to add that if you use default vue.2 template with vue/cli 5.0.8, You will get another error after installing vuetify, which was not able to fix.

Error is related to vuetify loader. I fixed it with start up new project and manually inserting all dependencies compatible with vuetify-loader 1.5 Because 1.7 brakes npm run serve

  • Related