403 Error on Angular 2 Website that is generated using angular-cli and IIS 7.5

1,526 views
Skip to first unread message

Fatih KARATAY

unread,
Feb 24, 2017, 9:10:13 AM2/24/17
to Angular and AngularJS discussion
I have my website that created by angular-cli tool. It works perfectly fine on localhost. However, when I deploy it to IIS 7.5, it gives me 403 error. What I did was to deploy another angular 2 website in the same folder with not using cli tool and it worked. So I'm thinking I don't have permission error. Somehow none of the angular 2 websites that generated by cli tool doesn't work on IIS 7.5 . I have my package.json file below if it helps:

{
  "name": "myauthapp",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "ng": "ng",
     "start": "ng serve",
      "lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-       check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
       "test": "ng test",
       "pree2e": "webdriver-manager update --standalone false --gecko    false",
       "e2e": "protractor"
   },
      "private": true,
       "dependencies": {
      "@angular/common": "^2.3.1",
      "@angular/compiler": "^2.3.1",
       "@angular/core": "^2.3.1",
       "@angular/forms": "^2.3.1",
       "@angular/http": "^2.3.1",
       "@angular/platform-browser": "^2.3.1",
       "@angular/platform-browser-dynamic": "^2.3.1",
       "@angular/router": "^3.3.1",
       "angularfire2": "^2.0.0-beta.7",
       "core-js": "^2.4.1",
       "firebase": "^3.6.5",
       "rxjs": "^5.0.1",
       "ts-helpers": "^1.1.1",
       "zone.js": "^0.7.2"
    },
      "devDependencies": {
       "@angular/compiler-cli": "^2.3.1",
       "@types/jasmine": "2.5.38",
       "@types/node": "^6.0.42",
       "angular-cli": "1.0.0-beta.25.5",
       "codelyzer": "~2.0.0-beta.1",
       "jasmine-core": "2.5.2",
        "jasmine-spec-reporter": "2.5.0",
        "karma": "1.2.0",
        "karma-chrome-launcher": "^2.0.0",
        "karma-cli": "^1.0.1",
        "karma-jasmine": "^1.0.2",
        "karma-remap-istanbul": "^0.2.1",
        "protractor": "~4.0.13",
        "ts-node": "1.2.1",
        "tslint": "^4.3.0",
        "typescript": "~2.0.3"
      }
   }

Sander Elias

unread,
Feb 27, 2017, 10:45:15 AM2/27/17
to Angular and AngularJS discussion
403 is really a server error. If you get this while clicking in your application, you probably not using the routerlink directive correctly.

Regards
Sander
Reply all
Reply to author
Forward
0 new messages