reflect-metadata shim is required when using class decorators
See original GitHub issueI am working on Angular 2… I have recently ran npm install
.
the project is running on angular-cli.
when I run the command ng build
. I am getting the below error.
reflect-metadata shim is required when using class decorators
Please help.
Here I am attaching my package.json and screenshot.
.
{ "name": "Sample Project", "version": "0.0.0", "license": "MIT", "angular-cli": {}, "scripts": { "start": "ng serve", "lint": "tslint \"src/**/*.ts\"", "test": "ng test", "pree2e": "webdriver-manager update", "e2e": "protractor" }, "private": true, "dependencies": { "@angular/common": "2.0.0-rc.5", "@angular/compiler": "2.0.0-rc.5", "@angular/core": "2.0.0-rc.5", "@angular/forms": "0.3.0", "@angular/http": "2.0.0-rc.5", "@angular/platform-browser": "2.0.0-rc.5", "@angular/platform-browser-dynamic": "2.0.0-rc.5", "@angular/router": "3.0.0-rc.1", "awesome-typescript-loader": "2.2.1", "bootstrap": "4.0.0-alpha.4", "core-js": "^2.4.0", "rxjs": "^5.0.0-beta.11", "ts-helpers": "^1.1.1", "typescript": "2.0.0", "webpack": "2.1.0-beta.21", "zone.js": "0.6.12", "loader-utils": "^0.2.16" }, "devDependencies": { "@types/jasmine": "^2.2.30", "angular-cli": "1.0.0-beta.17", "awesome-typescript-loader": "^2.2.1", "codelyzer": "~0.0.26", "jasmine-core": "2.4.1", "jasmine-spec-reporter": "2.5.0", "karma": "0.13.22", "karma-chrome-launcher": "0.2.3", "karma-jasmine": "0.3.8", "karma-remap-istanbul": "^0.2.1", "protractor": "4.0.3", "ts-node": "1.2.1", "tslint": "3.13.0", "typescript": "2.0.0", "webpack": "2.1.0-beta.21" } }
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
There are quite a few very old dependencies in that file. All Angular packages are from RC, the router is a version that has been rewritten 2 times since, RXJS is still beta etc.
The CLI will not support those versions or troubleshoot them I’m afraid.
My advice to you is to create a new project using the latest version of the CLI then create a new project with it, and start migrating your files to the new project. I expect it wont be an easy job because Angular must have changed a fair bit since that ancient version. but I’m afraid this is the only way to get Angular support, as RCs are not supported after Angular final was released, and the CLI itself is now using Angular 2.3 by default.
I know you said you upgraded the CLI, but I suggest you double check your installation (quite a few people thought it went well when it didn’t). The current version is beta 31. Please note that the package name changed from
angular-cli
to@angular/cli
. You can find instructions for upgrade in the README of this repository, or in this post. Re-do the upgrade just to be safe.Good luck.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.