Solve Vue error report unable to resolve dependency tree

 Table of contents

1. Problems

1.1 Problem description

Two, solve

2.1 Solution


1. Problems

1.1 Problem description

Create a new project today, that is, execute the Vue scaffolding creation code in an empty folder, as follows

vue create 项目名称

I did not expect to create an error: ERESOLVE unable to resolve dependency tree , the specific content of the error is as follows

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: [email protected]
npm ERR! node_modules/vue
npm ERR!   vue@"^3.0.0" from the root project
npm ERR!   peerOptional vue@"^2 || ^3.0.0-0" from @vue/[email protected]
npm ERR!   node_modules/@vue/babel-preset-app
npm ERR!     @vue/babel-preset-app@"^4.5.19" from @vue/[email protected]
npm ERR!     node_modules/@vue/cli-plugin-babel
npm ERR!       dev @vue/cli-plugin-babel@"~4.5.4" from the root project
npm ERR!   3 more (@vue/babel-preset-jsx, @vue/cli-plugin-typescript, vue-jest)

This is a bit inexplicable, and the scaffolding creation even reported an error.... 

Two, solve

2.1 Solution

After a little investigation based on the error, I found that the cause of this problem may be  caused by the incompatible version of node . At this time, I suddenly remembered that I switched node to 18 some time ago, and it may indeed be caused by this.

 Switch the version back to 14, and then execute the vue create project name , this time the project was created normally, without any abnormal errors

 The problem is perfectly solved... hereby record it for friends in need to inquire~

Guess you like

Origin blog.csdn.net/zy21131437/article/details/131882544