问题描述
我一直试图在nuxt.js中使用fontawesome图标,但是每当我运行npm run dev
时,都会出现此错误ERROR in ./node_modules/@fortawesome/free-solid-svg-icons/index.es.js Module build failed: Error: ENOENT: no such file or directory
我认为问题在于没有free-solid-svg-icons目录,但是当我尝试使用npm安装它时,它没有出现。
有人可以帮忙吗?
解决方法
我这样使用它:
在nuxt.config.js
中添加:
script:[
{src: "https://kit.fontawesome.com/xxxxxxx.js",crossorigin: "anonymous"},],
xxxxxxx
是试剂盒的ID(在FA网站上创建)