Skip to content

Commit

Permalink
nodejs版本升级新增报错信息采集
Browse files Browse the repository at this point in the history
  • Loading branch information
simply-none committed Apr 28, 2022
1 parent d16966c commit a18d301
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#### 每日十五谏

> 本博客运行依赖:`npm i docsify-cli -g --registry=https://registry.npmmirror.com`
##### 害怕改变,没有勇气及时止损。

要么沉溺于过去的辉煌,要么屈服于现实的安稳。人生只有一次,生命短暂多舛,多听听自己内心的声音,才能活出不废的人生啊。
Expand Down
39 changes: 39 additions & 0 deletions usage-project/项目版本升级.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,45 @@
1. 若出现:`RESOLVE unable to resolve dependency tree ix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps`,直接运行`npm install --force`
2. 清除npm缓存:`npm cache clean -f`
3. 切换更高级的版本后,出现依赖报错,例如:
<!-- tabs:start -->

<!-- tab:报错信息 -->
```bash
Z:\projects\aaa+4818\quality-app-web>npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: sitir-quality-web@0.2.0
npm ERR! Found: eslint-plugin-vue@8.7.1
npm ERR! node_modules/eslint-plugin-vue
npm ERR! dev eslint-plugin-vue@"^8.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
```

<!-- tab:解决方法 -->
```package.json
// 问题根源在于各个依赖包的依赖版本互不兼容,导致的错误,上述问题是:
// @vue/eslint-config-standard@6.1.0这个依赖包依赖于eslint-plugin-vue@"^7.0.0"
// 但是,项目中安装的依赖确是eslint-plugin-vue@"^8.6.0"
// 所以出现了错误

// 解决方法,为某个不兼容的依赖(eslint-plugin-vue)添加一个依赖范围,使得各个依赖于它的包都能正常运转
// origin
"eslint-plugin-vue": "^8.6.0",

// now
"eslint-plugin-vue": "^7.0.0 || ^8.6.0",
```
<!-- tabs:end -->

## web端项目(vue-cli创建的项目)

Expand Down

0 comments on commit a18d301

Please sign in to comment.