未找到模块:包路径./link未从包\node_modules\next-intl导出

but5z9lq  于 2023-10-18  发布在  其他
关注(0)|答案(1)|浏览(103)

在我的下一个js应用程序中,我只是将一个分支合并到另一个有重大变化的分支中,不得不解决冲突,一切看起来都很好,但在重新安装next-intl包后,得到了这个错误:
未找到模块:包路径./link未从包.\node_modules\next-intl导出(请参见.\node_modules\next-intl\package.json中的exports字段)
.重新安装没有帮助,也不能谷歌出来。有人能帮帮我吗?
next-intl structure
.\node_modules\next-intl\package.json代码:

{
  "name": "next-intl",
  "version": "3.0.0-rc.2",
  "sideEffects": false,
  "author": "Jan Amann <[email protected]>",
  "description": "A minimal, but complete solution for internationalization in Next.js apps.",
  "license": "MIT",
  "homepage": "https://next-intl-docs.vercel.app",
  "repository": {
    "type": "git",
    "url": "https://github.com/amannn/next-intl"
  },
  "main": "./dist/index.js",
  "module": "./dist/esm/index.js",
  "typings": "./dist/types/src/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/types/src/index.d.ts",
      "react-server": "./dist/esm/index.react-server.js",
      "default": "./dist/index.js"
    },
    "./server": {
      "types": "./server.d.ts",
      "react-server": "./dist/esm/server.react-server.js",
      "default": "./dist/server.js"
    },
    "./config": {
      "types": "./config.d.ts",
      "default": "./dist/config.js"
    },
    "./middleware": {
      "types": "./middleware.d.ts",
      "default": "./dist/middleware.js"
    },
    "./navigation": {
      "types": "./navigation.d.ts",
      "react-server": "./dist/esm/navigation.react-server.js",
      "default": "./dist/navigation.js"
    },
    "./plugin": {
      "types": "./plugin.d.ts",
      "default": "./dist/plugin.js"
    }
  },
  "files": [
    "dist",
    "server.d.ts",
    "navigation.d.ts",
    "middleware.d.ts",
    "plugin.d.ts",
    "config.d.ts"
  ],
  "keywords": [
    "react",
    "intl",
    "i18n",
    "internationalization",
    "localization",
    "translate",
    "translation",
    "format",
    "formatting",
    "next",
    "next.js"
  ],
  "dependencies": {
    "@formatjs/intl-localematcher": "^0.2.32",
    "negotiator": "^0.6.3",
    "server-only": "0.0.1",
    "use-intl": "3.0.0-beta.3"
  },
  "peerDependencies": {
    "next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0",
    "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
  },
  "devDependencies": {
    "@edge-runtime/vm": "^3.1.3",
    "@size-limit/preset-big-lib": "^8.2.6",
    "@testing-library/react": "^13.0.0",
    "@types/negotiator": "^0.6.1",
    "@types/node": "^17.0.23",
    "@types/react": "^18.2.5",
    "eslint": "^8.46.0",
    "eslint-config-molindo": "^7.0.0",
    "eslint-plugin-deprecation": "^1.4.1",
    "next": "13.5.2",
    "path-to-regexp": "^6.2.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "rollup": "^3.28.1",
    "rollup-plugin-preserve-directives": "0.2.0",
    "size-limit": "^8.2.6",
    "typescript": "^5.0.0",
    "vitest": "^0.32.2"
  },
  "size-limit": [
    {
      "path": "dist/production/index.js",
      "limit": "12.7 KB"
    },
    {
      "path": "dist/production/navigation.js",
      "limit": "2.6 KB"
    },
    {
      "path": "dist/production/server.js",
      "limit": "1.3 KB"
    },
    {
      "path": "dist/production/middleware.js",
      "limit": "5.9 KB"
    }
  ],
  "scripts": {
    "build": "rm -rf dist && rollup -c",
    "test": "TZ=Europe/Berlin vitest",
    "lint": "eslint src test && tsc --noEmit",
    "size": "size-limit"
  }
}
jgzswidk

jgzswidk1#

我只是遇到了同样的问题,并可以根据这个问题的答案来解决它(相关的,尽管与不同的函数有关)github问题:https://github.com/amannn/next-intl/issues/364-使用服务器组件测试版工作:https://next-intl-docs.vercel.app/docs/getting-started/app-router-server-components

npm install [email protected]

相关问题