我正在训练营的 Capstone 团队中工作。将其克隆到新的 Linux 计算机后,该项目无法安装该项目的依赖项。如何安装这些某些依赖项以便我的项目运行
npm run dev
?
ding@ding-Inspiron-7573: e $ npm install
HT WARN [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async request
y a key value, which is much more comprehensive and powerful.
npm [email protected]: Glob versions prior to v9 are no longer supported
npm [email protected]: Rimraf versions prior to v4 are no longer supported
npm @humanwhocodes/[email protected]: Use @eslint/object-schema instead
npm @humanwhocodes/config-array@®.11.14: Use @eslint/config-array instead
npm [email protected]: This package is deprecated and the repo was moved to bootstrap-vue organization. For updates on this project go to bootstrap-vue. The
package is called bootstrap-vue-next. Thanks for your support!
[sJUMWARN [email protected]: Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.
[JuMWARN [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy vl
added 271 packages, and audited 272 packages in 29s
99 packages are looking for funding
run “npm fund® for details
2 moderate severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run “npm audit’ for details.
ding@ding-Inspiron-7573: $ npm audit
# npm audit report
bootstrap 4.0.0 - 4.6.2
Severity: moderate
Bootstrap Cross-Site Scripting (XSS) vulnerability - https://github.com/advisories/GHSA-vc8w-jrov-vj7f
fix available via "npm audit fix --force’
Will install [email protected], which is a breaking change
node_modules/bootstrap-vue/node_modules/bootstrap
bootstrap-vue 0.5.1 - 0.10.1 || >=2.0.0-rc.0
Depends on vulnerable versions of bootstrap
node_modules/bootstrap-vue
2 moderate severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
这是包 JSON 文件 package.JSON文件
{
"name": "final-vue-capstone-seed",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"prepreview": "npm run build",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore src"
},
"dependencies": {
"@popperjs/core": "^2.11.8",
"axios": "^1.6",
"bootstrap-vue": "^2.23.1",
"bootstrap-vue-3": "^0.3.12",
"e": "^0.2.33",
"v-calendar": "^3.1.2",
"vue-router": "^4.2.1",
"vuex": "^4.1.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^3.2.0",
"bootstrap": "^5.3.3",
"eslint": "^8.42.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-vue": "^7.20.0",
"jquery": "^3.7.1",
"popper.js": "^1.16.1",
"vite": "^3.2.7",
"vue": "^3.2.45",
"vue-eslint-parser": "^9.3.0"
}
}
我尝试过
npm install --savedev "[email protected]
安装依赖项,但失败了。
然后它要求使用 npm install --legacy-peer-deps
安装其他依赖项,但这也失败了,导致消息再次返回安装“[email protected]”。
ding@ding-Inspiron-7573:~/Project/Medical-App/vue$ npm install --savedev "[email protected]"
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/vue
npm ERR! dev vue@"^3.2.45" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^2.4.2" from [email protected]
npm ERR! node_modules/bootstrap-vue
npm ERR! bootstrap-vue@"1.5.1" 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.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /home/ding/.npm/_logs/2024-08-30T19_14_50_801Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /home/ding/.npm/_logs/2024-08-30T19_14_50_801Z-debug-0.log
事实证明,
npm run dev
仍然可以运行。此版本的 Bootstrap 存在 Web 漏洞,因此需要更新以防止出现该漏洞,但没有任何问题。因此,对于个人项目,可以忽略警告,但如果将项目投入生产,则可能会被黑客攻击。