首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >怎样删除项目当中无用的npm包

怎样删除项目当中无用的npm包

作者头像
前端老道
发布于 2022-03-28 10:11:59
发布于 2022-03-28 10:11:59
3.1K0
举报
文章被收录于专栏:Vue开发社区Vue开发社区

在公司中,我们大部分都是多人共同开发和长时间维护一个项目,但是有时候我们会发现有很多已经废弃的npm 包存在 package.json 中,我们想要删除,但是又不能盲目的删除?那么 depcheck 它来了。

如何使用呢

第一步

全局安装:

代码语言:javascript
复制
npm install depcheck -g

第二步

项目更目录下执行 depcheck (这里拿我们自己的项目来做的测试),执行之后,根据自己得到的结果人工删除即可

代码语言:javascript
复制
Unused dependencies
* @xkeshi/vue-qrcode
* any-promise
* backpack-core
* cookie-universal-nuxt
* tls
* to
* vue-loader
* vue-meta-info
Unused devDependencies
* @babel/cli
* @babel/preset-es2015
* @babel/preset-react
* @babel/preset-stage-0
* @babel/register
* @nuxtjs/sentry
* axios-mock-adapter
* babel-eslint
* babel-loader
* babel-plugin-component
* child_process
* css-loader
* element-theme
* element-theme-chalk
* es3-compatible-webpack-plugin
* es3ify-loader
* eslint-friendly-formatter
* eslint-loader
* eslint-plugin-html
* express
* fs
* http-proxy-middleware
* jsencrypt
* lang
* net
* node-sass
* post-loader
* qs
* sass-loader
* vue-style-loader
* webpack-cli
Missing dependencies
* vue-no-ssr: ./.nuxt/components/no-ssr.js
* unfetch: ./.nuxt/client.js
* consola: ./.nuxt/client.js
* nuxt_plugin_route_338f5eda: ./.nuxt/index.js
* nuxt_plugin_main_6a83762f: ./.nuxt/index.js
* nuxt_plugin_http_6a8178fe: ./.nuxt/index.js
* nuxt_plugin_qrcode_7ec40a18: ./.nuxt/index.js
* nuxt_plugin_aliyunosssdkmin_02f21098: ./.nuxt/index.js
* nuxt_plugin_aliyunuploadsdk131min_c379eff6: ./.nuxt/index.js
* vue-router: ./.nuxt/router.js
* node-fetch: ./.nuxt/server.js
* vuex: ./.nuxt/store.js
* ~: ./assets/more-editor/more-editor.js
* resize-observer-polyfill: ./component/util/resizeEvent.js
* co: ./pages/circle/component/dakaEditor/editor.vue
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2020-05-13,如有侵权请联系 cloudcommunity@tencent.com 删除
目录
  • 如何使用呢
    • 第一步
    • 全局安装:
    • 第二步
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档