私は前にいくつかのポストを研究が、私は、私は私が過去に持っていなかったことを今週抱えているこの問題の解決策を見つけられませんでした同じコードの種類。ホストエージェントが、私はそこにプロジェクトをビルドしようとしている、そしてちょうどここに尋ね、私が得たすべてのアイデアを試してみてください。このエラーをトリガし、後だ -プロパティを読み取ることができません「置き換える」
私の問題は、VSTSの上に来ています。
私のマシン上では、ローカルで作業していると言えば、それは完璧に動作します。
私が試した事のいくつかは、次のとおりです。 - 最新バージョン へのアップデートCLI - 最新バージョン にアップデートTS - これは、だから、(それは他の問題を発生さ)main.tsから
をタイピングの参照を削除main.ts
/// <reference path="../typings/index.d.ts" />
require('core-js/shim');
require('zone.js/dist/zone');
require('reflect-metadata/temp/Reflect');
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
import { IEnvironment } from './_shared/entities/interfaces/index';
declare let environment: IEnvironment;
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
これは短いエラーログです:
./src/app/main.ts
Module build failed: TypeError: Cannot read property 'replace' of undefined
at Object.normalizeSlashes
これは長いですエラーログ:
0% compiling 10% building modules 0/1 modules 1 active multi main 10% building modules 1/1 modules 0 active 10% building modules 1/2 modules 1 active multi styles 10% building modules 2/2 modules 0 active 10% building modules 2/3 modules 1 active multi scripts 10% building modules 3/3 modules 0 active 10% building modules 3/4 modules 1 active ...ode_modules\signalr\jquery.signalR.js 10% building modules 4/4 modules 0 active 10% building modules 4/5 modules 1 active ...node_modules\underscore\underscore.js 10% building modules 5/5 modules 0 active 10% building modules 5/6 modules 1 active ...\s\node_modules\jquery\dist\jquery.js 10% building modules 6/6 modules 0 active 10% building modules 6/7 modules 1 active ...odules\bootstrap\dist\js\bootstrap.js 10% building modules 7/7 modules 0 active 10% building modules 7/8 modules 1 active ...node_modules\tether\dist\js\tether.js 10% building modules 8/8 modules 0 active 10% building modules 8/9 modules 1 active ....js?sourcemap!C:\a\1\s\src\style.scss 11% building modules 9/9 modules 0 active 11% building modules 9/10 modules 1 active ...js?sourcemap!C:\a\1\s\src\vendor.scss 11% building modules 10/10 modules 0 active 11% building modules 10/11 modules 1 active ...s\font-awesome\scss\font-awesome.scss 11% building modules 11/11 modules 0 active 11% building modules 11/12 modules 1 active ...ode_modules\signalr\jquery.signalR.js 11% building modules 11/13 modules 2 active ...node_modules\underscore\underscore.js 11% building modules 11/14 modules 3 active ...\s\node_modules\jquery\dist\jquery.js 11% building modules 11/15 modules 4 active ...odules\bootstrap\dist\js\bootstrap.js 11% building modules 11/16 modules 5 active ...node_modules\tether\dist\js\tether.js 11% building modules 11/17 modules 6 active ....js?sourcemap!C:\a\1\s\src\style.scss 11% building modules 11/18 modules 7 active ...js?sourcemap!C:\a\1\s\src\vendor.scss 11% building modules 11/19 modules 8 active ...s\font-awesome\scss\font-awesome.scss 11% building modules 11/20 modules 9 active ...src\index.js!C:\a\1\s\src\app\main.ts 11% building modules 11/21 modules 10 active ...de_modules\script-loader\addScript.js 11% building modules 11/22 modules 11 active ...ode_modules\style-loader\addStyles.js 11% building modules 12/22 modules 10 active ...ode_modules\style-loader\addStyles.js 11% building modules 13/22 modules 9 active ...ode_modules\style-loader\addStyles.js 11% building modules 14/22 modules 8 active ...ode_modules\style-loader\addStyles.js 11% building modules 15/22 modules 7 active ...ode_modules\style-loader\addStyles.js 11% building modules 16/22 modules 6 active ...ode_modules\style-loader\addStyles.js 12% building modules 17/22 modules 5 active ...ode_modules\style-loader\addStyles.js 12% building modules 18/22 modules 4 active ...s\font-awesome\scss\font-awesome.scss 12% building modules 19/22 modules 3 active ...s\font-awesome\scss\font-awesome.scss 12% building modules 20/22 modules 2 active ...s\font-awesome\scss\font-awesome.scss 12% building modules 20/23 modules 3 active ...de_modules\css-loader\lib\css-base.js 12% building modules 21/23 modules 2 active ...s\font-awesome\scss\font-awesome.scss 12% building modules 22/23 modules 1 active ...js?sourcemap!C:\a\1\s\src\vendor.scss 12% building modules 22/24 modules 2 active ...fonts\fontawesome-webfont.eot?v=4.7.0 12% building modules 22/25 modules 3 active ...awesome\fonts\fontawesome-webfont.eot 12% building modules 22/26 modules 4 active ...fonts\fontawesome-webfont.svg?v=4.7.0 12% building modules 22/27 modules 5 active ...nts\fontawesome-webfont.woff2?v=4.7.0 12% building modules 22/28 modules 6 active ...onts\fontawesome-webfont.woff?v=4.7.0 12% building modules 22/29 modules 7 active ...fonts\fontawesome-webfont.ttf?v=4.7.0 12% building modules 23/29 modules 6 active ...fonts\fontawesome-webfont.ttf?v=4.7.0 12% building modules 24/29 modules 5 active ...fonts\fontawesome-webfont.ttf?v=4.7.0 13% building modules 25/29 modules 4 active ...fonts\fontawesome-webfont.ttf?v=4.7.0 13% building modules 26/29 modules 3 active ...fonts\fontawesome-webfont.ttf?v=4.7.0 13% building modules 27/29 modules 2 active ...fonts\fontawesome-webfont.ttf?v=4.7.0 13% building modules 28/29 modules 1 active ...js?sourcemap!C:\a\1\s\src\vendor.scss 13% building modules 29/29 modules 0 active 13% building modules 29/30 modules 1 active ...\node_modules\animate.css\animate.css 13% building modules 30/30 modules 0 active 71% sealing 72% optimizing 73% basic module optimization 74% module optimization 75% advanced module optimization 76% basic chunk optimization 76% basic chunk optimization pass 2 76% basic chunk optimization pass 3 77% chunk optimization 78% advanced chunk optimization 79% module and chunk tree optimization 80% module reviving 81% module order optimization 82% module id optimization 83% chunk reviving 84% chunk order optimization 85% chunk id optimization 86% hashing 87% module assets processing 88% chunk assets processing 89% additional chunk assets processing 90% recording 91% additional asset processing 92% chunk asset optimization 94% asset optimization 95% emitting Hash: [1m0afac734d2396ef89b20[39m[22m
2016-12-08T17:37:42.0619446Z Time: [1m9032[39m[22mms
2016-12-08T17:37:42.0619446Z chunk {[1m[33m0[39m[22m} [1m[32mstyles.bundle.js, styles.bundle.map[39m[22m (styles) 290 kB {[1m[33m3[39m[22m}[1m[33m [initial][39m[22m[1m[32m [rendered][39m[22m
2016-12-08T17:37:42.0619446Z chunk {[1m[33m1[39m[22m} [1m[32mscripts.bundle.js, scripts.bundle.map[39m[22m (scripts) 649 kB {[1m[33m3[39m[22m}[1m[33m [initial][39m[22m[1m[32m [rendered][39m[22m
2016-12-08T17:37:42.0619446Z chunk {[1m[33m2[39m[22m} [1m[32mmain.bundle.js, main.bundle.map[39m[22m (main) 2.54 kB[1m[33m [initial][39m[22m[1m[32m [rendered][39m[22m
2016-12-08T17:37:42.0619446Z chunk {[1m[33m3[39m[22m} [1m[32minline.bundle.js, inline.bundle.map[39m[22m (inline) 0 bytes[1m[33m [entry][39m[22m[1m[32m [rendered][39m[22m
2016-12-08T17:37:42.0619446Z
2016-12-08T17:37:42.0619446Z [1m[31mERROR in ./src/app/main.ts
2016-12-08T17:37:42.0619446Z Module build failed: TypeError: Cannot read property 'replace' of undefined
2016-12-08T17:37:42.0619446Z at Object.normalizeSlashes (C:\a\1\s\node_modules\typescript\lib\typescript.js:1771:20)
2016-12-08T17:37:42.0619446Z at writeReferencePath (C:\a\1\s\node_modules\typescript\lib\typescript.js:37236:90)
2016-12-08T17:37:42.0619446Z at C:\a\1\s\node_modules\typescript\lib\typescript.js:35750:29
2016-12-08T17:37:42.0629440Z at Object.forEach (C:\a\1\s\node_modules\typescript\lib\typescript.js:1115:30)
2016-12-08T17:37:42.0629440Z at C:\a\1\s\node_modules\typescript\lib\typescript.js:35742:20
2016-12-08T17:37:42.0629440Z at Object.forEach (C:\a\1\s\node_modules\typescript\lib\typescript.js:1115:30)
2016-12-08T17:37:42.0629440Z at emitDeclarations (C:\a\1\s\node_modules\typescript\lib\typescript.js:35735:12)
2016-12-08T17:37:42.0629440Z at getDeclarationDiagnosticsFromFile (C:\a\1\s\node_modules\typescript\lib\typescript.js:35699:13)
2016-12-08T17:37:42.0629440Z at onSingleFileEmit (C:\a\1\s\node_modules\typescript\lib\typescript.js:7569:13)
2016-12-08T17:37:42.0629440Z at Object.forEachExpectedEmitFile (C:\a\1\s\node_modules\typescript\lib\typescript.js:7542:21)
2016-12-08T17:37:42.0629440Z at Object.getDeclarationDiagnostics (C:\a\1\s\node_modules\typescript\lib\typescript.js:35695:12)
2016-12-08T17:37:42.0629440Z at C:\a\1\s\node_modules\typescript\lib\typescript.js:45673:27
2016-12-08T17:37:42.0629440Z at runWithCancellationToken (C:\a\1\s\node_modules\typescript\lib\typescript.js:45468:24)
2016-12-08T17:37:42.0629440Z at getDeclarationDiagnosticsWorker (C:\a\1\s\node_modules\typescript\lib\typescript.js:45669:20)
2016-12-08T17:37:42.0629440Z at getDeclarationDiagnosticsForFile (C:\a\1\s\node_modules\typescript\lib\typescript.js:45677:60)
2016-12-08T17:37:42.0629440Z at getDiagnosticsHelper (C:\a\1\s\node_modules\typescript\lib\typescript.js:45436:24)
2016-12-08T17:37:42.0629440Z at Object.getDeclarationDiagnostics (C:\a\1\s\node_modules\typescript\lib\typescript.js:45460:24)
2016-12-08T17:37:42.0629440Z at TypeScriptFileRefactor.getDiagnostics (C:\a\1\s\node_modules\@ngtools\webpack\src\refactor.js:51:35)
2016-12-08T17:37:42.0629440Z at _checkDiagnostics (C:\a\1\s\node_modules\@ngtools\webpack\src\loader.js:106:32)
2016-12-08T17:37:42.0629440Z at C:\a\1\s\node_modules\@ngtools\webpack\src\loader.js:140:17
2016-12-08T17:37:42.0629440Z at tryCatch (C:\a\1\s\node_modules\es6-promise\dist\es6-promise.js:410:12)
2016-12-08T17:37:42.0629440Z at invokeCallback (C:\a\1\s\node_modules\es6-promise\dist\es6-promise.js:425:13)
2016-12-08T17:37:42.0629440Z at publish (C:\a\1\s\node_modules\es6-promise\dist\es6-promise.js:393:7)
2016-12-08T17:37:42.0629440Z at flush (C:\a\1\s\node_modules\es6-promise\dist\es6-promise.js:121:5)
2016-12-08T17:37:42.0629440Z at _combinedTickCallback (internal/process/next_tick.js:67:7)
2016-12-08T17:37:42.0629440Z at process._tickCallback (internal/process/next_tick.js:98:9)
2016-12-08T17:37:42.0629440Z @ multi main[39m[22m
EDIT。あなたが私にこのエラーを続行するにはいくつかのアイデア/助けを与えることができれば... Package.json
{
"name": "app",
"version": "1.0.0",
"description": "",
"main": "src/app/main.ts",
"scripts": {
"build": "ng build",
"start": "ng serve --host 0.0.0.0 --port 8080 --live-reload-port 49153",
"dev": "ng build && npm start",
"lint": "tslint --project ./tslint.json",
"test": "ng test --watch=false",
"postinstall": "gulp delete:types",
"compile-ts": "node node_modules/typescript/lib/tsc.js -p ./tsconfig.json",
"compile-sass": "gulp sass-compiler",
"compile": "npm run compile-ts && npm run compile-sass",
"clean": "gulp delete",
"zip": "gulp zip"
},
"author": "me",
"license": "MIT",
"dependencies": {
"@angular/common": "~2.1.0",
"@angular/compiler": "~2.1.0",
"@angular/core": "~2.1.0",
"@angular/forms": "~2.1.0",
"@angular/http": "~2.1.0",
"@angular/platform-browser": "~2.1.0",
"@angular/platform-browser-dynamic": "~2.1.0",
"@angular/router": "~3.1.0",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.14",
"angular-cli": "^1.0.0-beta.18",
"animate.css": "^3.5.2",
"bootstrap": "^4.0.0-alpha.4",
"core-js": "^2.4.1",
"font-awesome": "^4.6.3",
"jquery": "^3.1.1",
"karma-phantomjs-launcher": "^1.0.2",
"ng2-pagination": "^0.5.1",
"reflect-metadata": "^0.1.8",
"rxjs": "5.0.0-beta.12",
"signalr": "^2.2.1",
"systemjs": "0.19.39",
"underscore": "^1.8.3",
"zone.js": "^0.6.23"
},
"devDependencies": {
"codelyzer": "^1.0.0-beta.4",
"del": "^2.2.1",
"gulp": "^3.9.1",
"gulp-fail": "^1.0.5",
"gulp-sass": "^2.3.2",
"gulp-zip": "^3.0.2",
"jasmine-core": "2.4.1",
"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",
"ts-node": "1.2.1",
"tslint": "3.15.1",
"typescript": "~2.0.3",
"typings": "^1.4.0"
}
}
を追加すると、私は満足していますよ。
ありがとうございます! ;)
タイプ参照をどこかで使用しているかどうか確認できますか? '/// <参照パス= "..."/>' アップデート:私の悪い私はそれが正しいmain.tsファイルでご覧ください。代わりにnpm @typesを使ってみることはできますか? – borislemke
main.tsの '/// 'に問題が発生する可能性があります。私はcliの人たちがいつかこれをサポートしてくれなかったと思う。 –
borislemke
こんにちは@borislemke、タイピングの前に私のために働いていたが、今は '@types'に切り替える必要はない。もし私が最新の角度それはうまくいくはずですか? –