Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

国际化插件报错 #188

Closed
devenliu opened this issue May 2, 2020 · 2 comments
Closed

国际化插件报错 #188

devenliu opened this issue May 2, 2020 · 2 comments

Comments

@devenliu
Copy link

devenliu commented May 2, 2020

yarn start

warning in ./node_modules/moment/src/lib/locale/locales.js

Module not found: Error: Can't resolve './locale' in '~\node_modules\moment\src\lib\locale'

package.json

{
  "private": true,
  "scripts": {
    "start": "umi dev",
    "build": "umi build",
    "postinstall": "umi generate tmp",
    "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
    "test": "umi-test",
    "test:coverage": "umi-test --coverage"
  },
  "gitHooks": {
    "pre-commit": "lint-staged"
  },
  "lint-staged": {
    "*.{js,jsx,less,md,json}": [
      "prettier --write"
    ],
    "*.ts?(x)": [
      "prettier --parser=typescript --write"
    ]
  },
  "dependencies": {
    "@umijs/preset-react": "1.x",
    "@umijs/test": "^3.1.2",
    "lint-staged": "^10.0.7",
    "prettier": "^1.19.1",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "umi": "^3.1.2",
    "yorkie": "^2.0.0"
  },
}
@ycjcl868
Copy link
Contributor

ycjcl868 commented May 4, 2020

moment/moment#5472

@devenliu
Copy link
Author

moment/moment#5472

非常感谢 @ycjcl868 ,后来我排查了 @umijs/plugin-locale 源代码,依赖的 moment 版本是 "^2.*" ,并且我看到了 moment/moment#5472 这个 issue,所以我在我的项目中安装了 "moment": "2.24.0" 解决了这个问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants