###質問内容
Vue3を使用して開発中で、npm install
を実行したのですが、セキュリティ問題が発生しているようです。
問題を解消したいのですが、ご教授いただけると幸いです。
###環境
Node.js(node -v)
v16.13.0
###現在の状態
npm install
をすると下記が出力されます。
% npm install up to date, audited 1633 packages in 2s 107 packages are looking for funding run `npm fund` for details 46 vulnerabilities (20 moderate, 26 high) To address issues that do not require attention, run: npm audit fix To address all issues possible (including breaking changes), run: npm audit fix --force Some issues need review, and may require choosing a different dependency. Run `npm audit` for details.
上記にあるようにnpm audit
を実行したところ、下記が表示されます。
% npm audit # npm audit report glob-parent <5.1.2 Severity: high Regular expression denial of service - https://github.com/advisories/GHSA-ww39-953v-wcq6 No fix available node_modules/@vue/cli-plugin-eslint/node_modules/glob-parent node_modules/@vue/cli-plugin-typescript/node_modules/glob-parent node_modules/@vue/cli-service/node_modules/glob-parent node_modules/copy-webpack-plugin/node_modules/glob-parent node_modules/watchpack-chokidar2/node_modules/glob-parent node_modules/webpack-dev-server/node_modules/glob-parent chokidar 1.0.0-rc1 - 2.1.8 Depends on vulnerable versions of braces Depends on vulnerable versions of glob-parent Depends on vulnerable versions of readdirp node_modules/watchpack-chokidar2/node_modules/chokidar node_modules/webpack-dev-server/node_modules/chokidar watchpack-chokidar2 * Depends on vulnerable versions of chokidar node_modules/watchpack-chokidar2 watchpack 1.7.2 - 1.7.5 Depends on vulnerable versions of watchpack-chokidar2 node_modules/watchpack webpack 4.0.0-alpha.0 - 5.0.0-rc.6 Depends on vulnerable versions of micromatch Depends on vulnerable versions of watchpack node_modules/webpack -------------------------- 省略 -------------------------- set-value <4.0.1 Severity: high Prototype Pollution in set-value - https://github.com/advisories/GHSA-4jqc-8m5r-9rpr fix available via `npm audit fix --force` Will install @vue/cli-service@3.12.1, which is a breaking change node_modules/set-value cache-base >=0.7.0 Depends on vulnerable versions of set-value Depends on vulnerable versions of union-value node_modules/cache-base base 0.7.0 - 2.0.2 Depends on vulnerable versions of cache-base node_modules/base snapdragon 0.6.0 - 0.10.1 Depends on vulnerable versions of base node_modules/snapdragon braces 2.0.0 - 2.3.2 Depends on vulnerable versions of snapdragon node_modules/@vue/cli-plugin-eslint/node_modules/braces node_modules/@vue/cli-plugin-typescript/node_modules/braces node_modules/@vue/cli-service/node_modules/braces node_modules/fork-ts-checker-webpack-plugin/node_modules/braces node_modules/watchpack-chokidar2/node_modules/braces node_modules/webpack-dev-server/node_modules/braces node_modules/webpack/node_modules/braces -------------------------- 省略 -------------------------- 46 vulnerabilities (20 moderate, 26 high) To address issues that do not require attention, run: npm audit fix To address all issues possible (including breaking changes), run: npm audit fix --force Some issues need review, and may require choosing a different dependency.
次にnpm audit fix
を実行すると下記になります。
% npm audit fix npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @typescript-eslint/eslint-plugin@4.33.0 npm ERR! Found: eslint@6.8.0 npm ERR! node_modules/eslint npm ERR! dev eslint@"^6.8.0" from the root project npm ERR! peer eslint@"^5.0.0 || ^6.0.0 || ^7.0.0" from @typescript-eslint/eslint-plugin@4.33.0 npm ERR! node_modules/@typescript-eslint/eslint-plugin npm ERR! dev @typescript-eslint/eslint-plugin@"^4.33.0" from the root project npm ERR! peer @typescript-eslint/eslint-plugin@"^4.4.0" from @vue/eslint-config-typescript@7.0.0 npm ERR! node_modules/@vue/eslint-config-typescript npm ERR! dev @vue/eslint-config-typescript@"^7.0.0" from the root project npm ERR! 9 more (@typescript-eslint/experimental-utils, eslint-utils, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer eslint@"^5.0.0 || ^6.0.0 || ^7.0.0" from @typescript-eslint/eslint-plugin@4.33.0 npm ERR! node_modules/@typescript-eslint/eslint-plugin npm ERR! dev @typescript-eslint/eslint-plugin@"^4.33.0" from the root project npm ERR! peer @typescript-eslint/eslint-plugin@"^4.4.0" from @vue/eslint-config-typescript@7.0.0 npm ERR! node_modules/@vue/eslint-config-typescript npm ERR! dev @vue/eslint-config-typescript@"^7.0.0" from the root project npm ERR! npm ERR! Conflicting peer dependency: eslint@7.32.0 npm ERR! node_modules/eslint npm ERR! peer eslint@"^5.0.0 || ^6.0.0 || ^7.0.0" from @typescript-eslint/eslint-plugin@4.33.0 npm ERR! node_modules/@typescript-eslint/eslint-plugin npm ERR! dev @typescript-eslint/eslint-plugin@"^4.33.0" from the root project npm ERR! peer @typescript-eslint/eslint-plugin@"^4.4.0" from @vue/eslint-config-typescript@7.0.0 npm ERR! node_modules/@vue/eslint-config-typescript npm ERR! dev @vue/eslint-config-typescript@"^7.0.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. npm ERR! npm ERR! See /Users/ユーザー名/.npm/eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in: npm ERR! /Users/ユーザー名/.npm/_logs/2021-11-11T15_36_37_574Z-debug.log
上記のようにnpm audit fix
もできない状態です。
eslint
が関係ありそうだったので、npm ls eslint
を実行したところ、下記が出力されました。
% npm ls eslint vue3-app@0.1.0 /Users/ユーザー名/practice/vue3-app ├─┬ @typescript-eslint/eslint-plugin@4.33.0 │ ├─┬ @typescript-eslint/experimental-utils@4.33.0 │ │ ├─┬ eslint-utils@3.0.0 │ │ │ └── eslint@6.8.0 deduped │ │ └── eslint@6.8.0 deduped │ └── eslint@6.8.0 deduped ├─┬ @typescript-eslint/parser@4.33.0 │ └── eslint@6.8.0 deduped ├─┬ @vue/cli-plugin-eslint@4.5.15 │ ├─┬ eslint-loader@2.2.1 │ │ └── eslint@6.8.0 deduped │ └── eslint@6.8.0 deduped ├─┬ @vue/eslint-config-typescript@7.0.0 │ ├── eslint@6.8.0 deduped │ └─┬ vue-eslint-parser@7.11.0 │ └── eslint@6.8.0 deduped ├─┬ eslint-plugin-vue@7.20.0 │ ├── eslint@6.8.0 deduped │ └─┬ vue-eslint-parser@7.11.0 │ └── eslint@6.8.0 deduped └── eslint@6.8.0
下記はpackage.json
の内容になります。
{ "name": "vue3-app", "version": "0.1.0", "private": true, "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": "vue-cli-service lint" }, "dependencies": { "@tailwindcss/postcss7-compat": "^2.2.17", "autoprefixer": "^9.8.8", "core-js": "^3.6.5", "postcss": "^7.0.39", "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.17", "vue": "^3.0.0", "vue-router": "^4.0.0-0", "vuex": "^4.0.0-0" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/parser": "^4.33.0", "@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-plugin-router": "~4.5.0", "@vue/cli-plugin-typescript": "~4.5.0", "@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-service": "~4.5.0", "@vue/compiler-sfc": "^3.0.0", "@vue/eslint-config-typescript": "^7.0.0", "eslint": "^6.8.0", "eslint-plugin-vue": "^7.0.0", "typescript": "~4.1.5" } }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/11/12 17:14