Modulni tuzish muvaffaqiyatsiz tugadi: TypeError: 'newLine' xususiyatini undefined o'qib bo'lmadi

enter image description here

Kecha kechqurun hamma narsa yaxshi edi, endi xizmat qilishga urinib ko'rsam, bu xatoni qo'lga kiritaman:

./src/main.ts da xato   Modulni tuzish muvaffaqiyatsiz tugadi: TypeError: 'newLine' xususiyatini undefined o'qib bo'lmadi       Object.getNewLineCharacter'da (/Users/leongaban/Projects/TickerTags/wikitags/node_modules/typescript/lib/typescript.js:8062:20)

Javoblarni sinab ko'rdim ​​Bu yerda va bu yerda lekin ta'sir yo'q :(

My global and local npm version for angular-cli is 1.0.0-beta.28.3 how do I upgrade that to .30? I tried @latest


Mahalliy package.json:

"devDependencies": {
    "@angular/cli": "1.0.0-beta.28.3",
    "@angular/compiler-cli": "^2.4.0",

Mening global paketim:

enter image description here


I see that the latest is beta.32 https://github.com/angular/angular-cli/releases

However when I run npm install -g [email protected] it still installs .28.3

10
Ajablanarlisi shundaki, buni node_modules papkasini o'chirib, keyin hamma narsani qayta tiklashi mumkin.
qo'shib qo'ydi muallif sandrooco, manba
ng -v mahalliy va global uchun bir xil paketni qaytaradimi?
qo'shib qo'ydi muallif sandrooco, manba

7 javoblar

OS: burchakli Windows 4

"@ Angular/cli": "1.2.1"

"@ burchakli/material": "2.0.0-beta.6"

Men yuqoridagi ikkita bog'liqlikdan olib tashladim va quyidagi qadamlarni qildim: har bir narsa mukammal ishlay boshladi.

  1. node_module o'chirilsin
  2. burchakli klientni mahalliy va globaldan o'chirish
  3. Ikkala burchak clini bir xil versiyasini o'rnating.
  4. "npm o'rnatish" ni bajaring.
  5. "xizmat qilish"
2
qo'shib qo'ydi

Package.json da o'zgartirdim:

"devDependencies": {
   "@angular/cli": "1.0.0"

Kimga:

"devDependencies": {
   "@angular/cli": "1.2.0"
2
qo'shib qo'ydi

Shu sababli @ angular/cli @ ning eng so'nggi versiyasi men uchun ishlaydi, ehtimol kelajakda ishlashim mumkin.

ng serve - yaxshi ishlaydigan yana bir angular2 loyihasi bor edi. Shuning uchun men undan package.json bog'liqliklarini kopyaladım va angular-cli.json'u yangiladim.

Va endi u yana ishlaydi!

package.json

"dependencies": {
    "@angular/common": "^2.4.0",
    "@angular/compiler": "^2.4.0",
    "@angular/core": "^2.4.0",
    "@angular/forms": "^2.4.0",
    "@angular/http": "^2.4.0",
    "@angular/platform-browser": "^2.4.0",
    "@angular/platform-browser-dynamic": "^2.4.0",
    "@angular/router": "^3.4.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.0.1",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.7.2"
  },
  "devDependencies": {
    "@angular/cli": "1.0.0-beta.31",
    "@angular/compiler-cli": "^2.4.0",
    "@types/jasmine": "2.5.38",
    "@types/node": "^6.0.42",
    "codelyzer": "~2.0.0-beta.1",
    "css-loader": "^0.26.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-coverage-istanbul-reporter": "^0.2.0",
    "karma-jasmine": "^1.0.2",
    "node-sass": "^4.5.0",
    "node-sass-import": "^1.1.1",
    "protractor": "~5.1.0",
    "sass-loader": "^6.0.0",
    "source-map-loader": "^0.1.6",
    "ts-node": "1.2.1",
    "tslint": "^4.3.0",
    "typescript": "~2.0.0"
  }

angular-cli.json

Eski turdagi "source" kalitiga qaytib kelish kerak edi

"environments": {
    "source": "environments/environment.ts",
    "dev": "environments/environment.ts",
    "prod": "environments/environment.prod.ts"
}
1
qo'shib qo'ydi
Bu shunchaki exp
qo'shib qo'ydi muallif SuperUberDuper, manba

"@ Angular/cli" ga yangilang: "1.0.0-rc.0" "@ angular/compiler-cli": package.json "2.4.0" ni oching va quyidagi kabi burchak-cli.json faylini yangilang

o'zgartirish

"environments": {
    "source": "environments/environment.ts",
    "dev": "environments/environment.ts",
    "prod": "environments/environment.prod.ts"
}

tomonidan

"environmentSource": "environments/environment.ts",
      "environments": {
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }  
1
qo'shib qo'ydi

Boshqa @angular modullariga mos kelish uchun @ angular/cli to'plami nomiga ko'chib o'tishdi. Eski fayllar bilan qolmaganingizga ishonch hosil qilish uchun quyidagi amallarni bajaring:

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/[email protected]

keyin mahalliy node_modules papkasini olib tashlang va quyidagi amallarni bajaring:

npm install --save-dev @angular/[email protected]
npm install

Eng so'nggi burchak qismli versiya .32. Yana yangi versiyalarni yangilash bilan bog'liq muammolar mavjud, ammo umid qilamanki keyingi yangilanishlar ular nazorati ostida bo'ladi. Aks holda, yuqorida eslatgan qadamlarni takrorlang

0
qo'shib qo'ydi
Rahmat, men buni qildim ... va mening global va mahalliy kodimda 1.0.0-beta.32.3 bor. ng yana xizmat qildi va angular-cli.json faylida kichik yangilashni amalga oshirdi. Ran ng yana xizmat qiladi va shu bilan birga bu xatoni oladi: (O'ylaymanki keyingi versiyaga qadar kutishim kerakmi?
qo'shib qo'ydi muallif Leon Gaban, manba
"@ angular/compiler-cli": "^ 2.4.0", bu versiyada, bu muhimmi?
qo'shib qo'ydi muallif Leon Gaban, manba

Men uchun ishlagan narsa:

diff --git a/angular-cli.json b/angular-cli.json
index d74d5d4..2641672 100644
--- a/angular-cli.json
+++ b/angular-cli.json
@@ -1,7 +1,7 @@
 {
   "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
   "project": {
-    "version": "1.0.0-beta.31",
+    "version": "1.0.0-beta.28",
     "name": "renaissance"
   },
   "apps": [
@@ -22,8 +22,8 @@
         "styles.less"
       ],
       "scripts": [],
+      "environmentSource": "environments/environment.ts",
       "environments": {
-        "source": "environments/environment.ts",
         "dev": "environments/environment.ts",
         "prod": "environments/environment.prod.ts"
       }
diff --git a/package.json b/package.json
index b91db8f..7e2b083 100644
--- a/package.json
+++ b/package.json
@@ -12,13 +12,13 @@
   },
   "private": true,
   "dependencies": {
-    "@angular/common": "^2.4.0",
-    "@angular/compiler": "^2.4.0",
-    "@angular/core": "^2.4.0",
-    "@angular/forms": "^2.4.0",
-    "@angular/http": "^2.4.0",
-    "@angular/platform-browser": "^2.4.0",
-    "@angular/platform-browser-dynamic": "^2.4.0",
+    "@angular/common": "^2.4.8",
+    "@angular/compiler": "^2.4.8",
+    "@angular/core": "^2.4.8",
+    "@angular/forms": "^2.4.8",
+    "@angular/http": "^2.4.8",
+    "@angular/platform-browser": "^2.4.8",
+    "@angular/platform-browser-dynamic": "^2.4.8",
     "@angular/router": "^3.4.0",
     "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.20",
     "angularfire2": "^2.0.0-beta.8",
@@ -27,15 +27,14 @@
     "font-awesome": "^4.7.0",
     "moment": "^2.17.1",
     "ng2-bootstrap": "^1.3.3",
-    "ng2-page-transition": "^0.2.6",
+    "ng2-page-transition": "^1.0.4",
     "rxjs": "^5.0.1",
     "ts-helpers": "^1.1.1",
     "web-animations-js": "^2.2.2",
     "zone.js": "^0.7.2"
   },
   "devDependencies": {
-    "@angular/cli": "1.0.0-beta.31",
-    "@angular/compiler-cli": "^2.4.0",
+    "@angular/cli": "^1.0.0-beta.32.3",
     "@types/jasmine": "2.5.38",
     "@types/node": "^6.0.42",
     "codelyzer": "~2.0.0-beta.1",
@@ -44,8 +43,8 @@
     "karma": "1.2.0",
     "karma-chrome-launcher": "^2.0.0",
     "karma-cli": "^1.0.1",
-    "karma-jasmine": "^1.0.2",
     "karma-coverage-istanbul-reporter": "^0.2.0",
+    "karma-jasmine": "^1.0.2",
     "protractor": "~5.1.0",
     "ts-node": "1.2.1",
     "tslint": "^4.3.0",
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 1f862c6..b6568b7 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -8,7 +8,7 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
//App modules/components
 import {LayoutsModule} from "./Components/common/layout/layout.module";
 import {BlochWidgetsModule} from "./Components/common/widgets/widgets.module";
-import {Ng2PageTransition} from "ng2-page-transition";
+import {Ng2PageTransitionModule} from "ng2-page-transition";
 //services
 import {PeopleHttpService} from "./Components/common/service/httpPeople.service";
 //auth Module
@@ -30,9 +30,9 @@ import {MessagingModule} from "./views/messaging/messaging.module";
 @NgModule({
   declarations: [
     AppComponent,
-    Ng2PageTransition,
   ],
   imports: [
+    Ng2PageTransitionModule,
     BrowserModule,
     FormsModule,
     HttpModule,
0
qo'shib qo'ydi
Bu savolga javob bera olasizmi? Ko'pchiligimiz PeopleHttpService yoki BlochWidgetsModule dan foydalanmaydi. Xatolikka yo'l qo'ymaslikdan avval, siz o'zingizning ish joyingizda ishlash uchun nima o'zgargan?
qo'shib qo'ydi muallif Joshua Drake, manba

This worked for me :-
rm -rf node_modules && npm cache clean && npm uninstall --save angular-cli; npm uninstall -g angular-cli; npm i --save @angular/cli && npm i -g @angular/cli && npm i

rm -rf node_modules/loyihangizda barcha barcha narsalaridan qutilish uchun, keyin npm keshni tozalash va keyin npm o'rnatish ham ushbu muammoni hal qilish kerak. Bundan tashqari, klipning mahalliy va global versiyalariga mosligiga ishonch hosil qiling.

https://github.com/angular/angular-cli/issues/3781

0
qo'shib qo'ydi
Angular Uzbekistan
Angular Uzbekistan
107 ishtirokchilar

Guruh Angular bo'yicha muloqot qilish uchun ochilgan Sizni qiziqtirsa: @nodejs_uz @react_uz @angular_uz @yiiframework_uz @js_uzb @typescript_uzb @vuejs_uz @ngTashkent @laravel_uz @uzdevgroup Ish o'rinlari @UzDev_jobs

Javascript UZB
Javascript UZB
99 ishtirokchilar

@js_uzb @vuejs_uz @react_uz @nodejs_uz @angular_uz @ngTashkent @yiiframework_uz @laravel_uz @linux_uzbek @python_uz @swift_uzb —————— @uzdevgroup @UzGeeksGroup ——— @UzDev_Jobs @jobs_uzb

ngTashkent
ngTashkent
77 ishtirokchilar

Правила просты: 1. Не хамить 2. Не хейтить 3. Реакт не нужен Ссылки: https://t.me/angular_ru - старший брат https://t.me/angular_uz - ангулар на узбекском @js_uzb @vuejs_uz @react_uz @nodejs_uz @yiiframework_uz @uzdevgroup @UzDev_Jobs @tasdev_talks