我是棱角分明的新人。我能够在本地运行我的角度应用程序,直到我将它推送到heroku。此错误显示在我的本地计算机上。在heroku上,它有另一个错误Unexpected token <
不确定它是否相关。
所以我不知道去哪里调试此错误scripts.bundle.js net::ERR_ABORTED
和scripts.bundle.js 404 (Not Found)
。此错误显示在应用程序的根目录中。任何指导或某种方向都会非常感激!
的package.json
{
"name": "user-app",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng server.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "ng build --aot -prod"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/cli": "^1.5.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/compiler-cli": "^5.0.0",
"@angular/core": "^5.0.0",
"@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",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.5",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"enhanced-resolve": "^3.3.0",
"express": "4.16.2",
"jquery": "^3.2.1",
"jw-bootstrap-switch-ng2": "^1.0.7",
"ng2-nouislider": "^1.7.4",
"nouislider": "^10.1.0",
"popper.js": "^1.12.3",
"rxjs": "^5.4.2",
"typescript": "2.6.1",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/language-service": "^5.0.0",
"@types/jasmine": "~2.6.2",
"@types/jasminewd2": "~2.0.2",
"@types/jquery": "^3.2.16",
"@types/node": "~8.0.47",
"codelyzer": "~4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.2.0",
"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.2.0",
"ts-node": "~3.3.0",
"tslint": "~5.8.0"
},
"engines": {
"node": "6.11.5",
"npm": "5.5.1"
}
}
的index.html
<head>
<base href="/">
</head>
<body class="full-screen">
<app-root></app-root>
</body>
答案 0 :(得分:0)
我在更新角度4到5和cli 1.4.7到1.5
时遇到了同样的错误我修好了它:
npm cache verify
我希望这也能解决你的问题。
答案 1 :(得分:0)
在index.html页面中检查标记<base href="/">
。如果<base href="/YOUR_APP_NAME/">
,则会给出相同的错误。