我一直在尝试将VueUse运动与Nuxt3结合使用。我遵循文档并安装了@vueuse/motio,并在我将'@vueuse/motion/nuxt'添加到nuxt.config.ts文件之后。但是,当我想运行dev服务器时,它会产生以下错误:
Cannot start nuxt: Package subpath './nuxt' is not defined by "exports" in C:\Users\orhan\Desktop\p3\node_modules\@vueuse\motion\package.json

这里是我在nuxt.config.ts 中的模块
modules: [
'@nuxtjs/i18n',
'@nuxtjs/tailwindcss',
'@vueuse/nuxt',
'@pinia/nuxt',
'@vueuse/motion/nuxt',
],我的package.json 文件:
"devDependencies": {
"@iconify/json": "^2.1.116",
"@nuxt/types": "^2.15.8",
"@nuxtjs/google-fonts": "^3.0.0-0",
"@nuxtjs/tailwindcss": "^5.3.3",
"@tailwindcss/typography": "^0.5.7",
"@vueuse/motion": "^2.0.0-beta.12",
"nuxt": "3.0.0-rc.11",
"prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.1.13",
"sass": "^1.55.0",
"sass-loader": "^13.0.2",
"unplugin-icons": "^0.14.11",
"unplugin-vue-components": "^0.22.7"
},
"dependencies": {
"@nuxtjs/i18n": "^8.0.0-alpha.2",
"@pinia/nuxt": "^0.4.2",
"@vueuse/nuxt": "^9.3.0",
"daisyui": "^2.31.0"
}发布于 2022-10-12 00:12:54
您使用的nuxt版本(3.0.0-rc.11)与@vueuse/motion@2.0.0-beta.12存在兼容性问题。
解决方案:
在您的package.json中,只需尝试将"@vueuse/motion": "^2.0.0-beta.12"更改为"@vueuse/motion": "^2.0.0-beta.23"。
然后运行pnpm install和pnpm dev。
发布于 2022-11-12 04:36:22
请将@vueuse/motion升级到最新版本。
https://stackoverflow.com/questions/73925014
复制相似问题