【发布时间】:2021-09-21 05:34:43
【问题描述】:
我尝试在我的 Nuxt 项目中使用它,但在编译时失败了
在我的插件/sharp.js 中
import vue from "vue"
import sharp from "sharp"
vue.use(sharp)
还有我的 nuxt.config.js
plugins: [
'~plugins/sharp.js',
],
编译时我的终端出现错误
Failed to compile with 4 errors friendly-errors 01:16:19
These dependencies were not found: friendly-errors 01:16:19
friendly-errors 01:16:19
* child_process in ./node_modules/detect-libc/lib/detect-libc.js, ./node_modules/sharp/lib/libvips.js friendly-errors 01:16:19
* fs in ./node_modules/detect-libc/lib/detect-libc.js, ./node_modules/sharp/lib/libvips.js friendly-errors 01:16:19
friendly-errors 01:16:19
To install them, you can run: npm install --save child_process fs
【问题讨论】:
-
@kissu 不,它没有帮助,我已经用解释回复了你的答案。
标签: javascript node.js vue.js nuxt.js