@vue-icons/feather 没有找到依赖项

@vue-icons/feather dependency was not found

我有一个正在处理的简单 Nuxt 项目,我安装了 Vue Icons 并尝试向我的组件添加一个搜索图标,但在编译时出现以下错误:

This dependency was not found:                                                                                                                                                 
                                                                                                                                                                               
* @vue-icons/feather in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./components/SiteHeader.vue?vue&type=script&lang=js&       
                                                                                                                                                                              
To install it, you can run: npm install --save @vue-icons/feather   

但我已经在我的 src 和函数文件夹中安装了它(我在 firebase 上托管)

"dependencies": {
  "@nuxtjs/firebase": "^7.6.1",
  "@vue-icons/feather": "^1.0.19",
  "firebase": "^8.9.1",
  "isomorphic-fetch": "^3.0.0",
  "nuxt": "^2.0.0"
}

我用的导入语句是直接从网站上复制过来的

import { SearchIcon } from "@vue-icons/feather";

我读到的一些类似问题谈到了 ,但这似乎不起作用,我是否需要将第 3 方库添加到 nuxt.config 文件的其他部分?

我会引用文档中写的内容

This project aims to regroup [...] common icons pack for Vue 3.

Nuxt2 与 Vue3 不兼容。

如果您想使用完全相同的 vue-feather-icons 库,请为此目的使用 this package

它应该像

一样容易工作
<template>
  <div>
    <ActivityIcon />
  </div>
</template>

<script>
import { ActivityIcon } from 'vue-feather-icons'

export default {
  components: {
    ActivityIcon
  }
}
</script>

不然我也可以推荐unplugin-icons which will provide a LOT more and will be really flexible. And which also totally contains the icons you're looking for.

很棒的包,无需处理在其他功能之上查找工作包的所有烦人部分。