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

Error: Can't resolve './locale' #4540

Closed
michDostal opened this issue Apr 9, 2018 · 3 comments
Closed

Error: Can't resolve './locale' #4540

michDostal opened this issue Apr 9, 2018 · 3 comments

Comments

@michDostal
Copy link

WARNING in ./node_modules/moment/src/lib/locale/locales.js
Module not found: Error: Can't resolve './locale' in 'C:\Users###\Projects###\node_modules\moment\src\lib\locale'
resolve './locale' in 'C:\Users###\Projects###\node_modules\moment\src\lib\locale'
using description file: C:\Users###\Projects###\node_modules\moment\package.json (relative path: ./src/lib/locale)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:\Users###\Projects###\node_modules\moment\package.json (relative path: ./src/lib/locale)
using description file: C:\Users###\Projects###\node_modules\moment\package.json (relative path: ./src/lib/locale/locale)
as directory
C:\Users###\Projects###\node_modules\moment\src\lib\locale\locale doesn't exist
[C:\Users###\Projects###\node_modules\moment\src\lib\locale\locale]
@ ./node_modules/moment/src/lib/locale/locales.js 56:12-46
@ ./node_modules/moment/src/lib/locale/locale.js
@ ./node_modules/moment/src/moment.js
@ ./src/app/00-components/core/utils/date/moment-date.pipe.ts
@ ./src/app/shared.module.ts
@ ./src/app/01-layout/layout.module.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts

Description of the Issue and Steps to Reproduce:
Installed and included momentjs to angular-cli and this warning occured.
Tried different versions (2.18.1, 2.19.1, 2.21.0) but nothing helped

using momentjs in default configuration

Environment:

Windows 10 Pro,
Angular CLI: 1.6.8
Node: 9.11.1
Angular: 5.2.9

Other information that may be helpful:
timezone CEST

  • 09.04.2018 - The time and date at which the code was run
  • Other libraries in use:
"dependencies": {
    "@angular/animations": "^5.2.3",
    "@angular/cdk": "^5.2.0",
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/flex-layout": "2.0.0-beta.12",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/router": "^5.0.0",
    "@ngrx/store": "^5.0.0",
    "@ngx-translate/core": "^9.1.1",
    "@swimlane/ngx-datatable": "^11.2.0",
    "@types/lodash": "^4.14.106",
    "angular2-jsonapi": "^4.1.0",
    "core-js": "^2.4.1",
    "immutable": "^4.0.0-rc.9",
    "lodash": "^4.17.5",
    "moment": "^2.21.0",
    "moment-timezone": "^0.5.14",
    "ng2-date-picker": "^2.8.1",
    "ngx-ckeditor": "^0.3.1",
    "ngx-perfect-scrollbar": "^5.3.5",
    "node-sass": "^4.7.2",
    "normalize-scss": "^7.0.1",
    "npm": "^5.8.0",
    "rxjs": "^5.5.2",
    "sass-loader": "^6.0.6",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular-devkit/core": "0.0.29",
    "@angular/cli": "~1.6.8",
    "@angular/compiler-cli": "^5.0.0",
    "@angular/language-service": "^5.0.0",
    "@types/chai": "^4.1.2",
    "@types/cucumber": "^4.0.1",
    "@types/node": "~6.0.60",
    "chai": "^4.1.2",
    "chai-as-promised": "^7.1.1",
    "codelyzer": "^4.0.1",
    "cucumber": "^4.0.0",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "protractor-cucumber-framework": "^4.2.0",
    "ts-node": "^4.1.0",
    "tslint": "~5.7.0",
    "typescript": "~2.4.2"
  }

If you are reporting an issue, please run the following code in the environment you are using and include the output:

Mon Apr 09 2018 11:51:27 GMT+0200 (Central Europe Daylight Time)
9. 4. 2018 11:51:27
-120
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
2.21.0
@marwahaha
Copy link
Member

Is this a duplicate of #4505 ?

@michDostal
Copy link
Author

@marwahaha it's possible that it's the same issue. I somehow missed that issue when searching for solutions.

@marwahaha
Copy link
Member

Ok, closing as a duplicate. There are a couple of workarounds in that ticket, I think.

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