按照docs,我通过
npm install -D @nuxtjs/google-fonts
安装了软件包(因为我正在使用Nuxt v2.14.7
),然后将“@nuxtjs/google-fonts”添加到buildModules
中的nuxt.config.js
数组中。
只要这样做,我立即收到此错误:
致命的未知文件扩展名: D:\项目... ode_modules\pathe\dist\index.cjs
错误 [ERR_UNKNOWN_FILE_EXTENSION]:未知的文件扩展名: node_modules\pathe\dist\index.cjs 位于 /D:/projects/.../node_modules/@nuxtjs/google-fonts/dist/module.mjs:1 在 Generator.next ()
知道这里出了什么问题吗?
node_modules
文件夹,package.lock.json
,npm cache clean --force
,npm install
如果这不起作用,请尝试使用
@nuxtjs/google-fonts
删除 npm remove @nuxtjs/google-fonts
并重新安装 npm install -D @nuxtjs/google-fonts
我希望这能成功