पर अपग्रेड करने के बाद नाम 'Iterable' नहीं मिल रहा है मैं टाइपस्क्रिप्ट 2.4.1 का उपयोग कर रहा हूं और मेरे प्रोजेक्ट में कई पैकेज अपग्रेड कर चुका हूं। उनमें से मैंने कोणीय को 2 से 4.3.1 तक अपग्रेड किया। @types संकुल में कई सुधार के बाद, त्रुटियों मैं के साथ छोड़ दिया हूँ हैं:त्रुटि टीएस 2304: बिल्ड: कोणीय 4
\node_modules\@types\jquery\index.d.ts(2955,63): error TS2304: Build:Cannot find name 'Iterable'.
\node_modules\@types\three\three-core.d.ts(767,24): error TS2304: Build:Cannot find name 'Iterable'.
\node_modules\@types\three\three-core.d.ts(771,24): error TS2304: Build:Cannot find name 'Iterable'.
\node_modules\@types\three\three-core.d.ts(775,24): error TS2304: Build:Cannot find name 'Iterable'.
\node_modules\@types\three\three-core.d.ts(779,24): error TS2304: Build:Cannot find name 'Iterable'.
\node_modules\@types\three\three-core.d.ts(783,24): error TS2304: Build:Cannot find name 'Iterable'.
\node_modules\@types\three\three-core.d.ts(787,24): error TS2304: Build:Cannot find name 'Iterable'.
\node_modules\@types\three\three-core.d.ts(791,24): error TS2304: Build:Cannot find name 'Iterable'.
\node_modules\@types\three\three-core.d.ts(795,24): error TS2304: Build:Cannot find name 'Iterable'.
\node_modules\@types\three\three-core.d.ts(799,24): error TS2304: Build:Cannot find name 'Iterable'.
मैं इसी तरह के कई सवाल और जवाब और प्रचलित समाधान लक्षित करने के लिए "es2015" और/या lib जोड़ने है पाया है: [ " डोम "," es2015 "," es2015.iterable "]। मैंने उन सभी को और अधिक कोशिश की है लेकिन अभी भी एक ही 'Iterable' त्रुटि के साथ छोड़ दिया गया है।
मेरे अद्यतन tsconfig.json इस प्रकार है:
{
"compileOnSave": true,
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "dom", "dom.iterable", "es2015", "es2015.iterable", "esnext" ],
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
"noEmitOnError": true,
"outDir": "./wwwroot/js",
"removeComments": false,
"rootDir": "./Client",
"sourceMap": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es2015",
"typeRoots": [
"./node_modules/@types",
"./Client"
]
},
"exclude": [
"node_modules",
"wwwroot/lib"
],
"filesGlob": [
"./Client/**/*.ts"
]
}
मेरे package.json है:
{
"version": "1.0.0",
"name": "web-server",
"private": true,
"dependencies": {
"@angular/common": "^4.3.1",
"@angular/compiler": "^4.3.1",
"@angular/core": "^4.3.1",
"@angular/forms": "^4.3.1",
"@angular/http": "^4.3.1",
"@angular/platform-browser": "^4.3.1",
"@angular/platform-browser-dynamic": "^4.3.1",
"@angular/router": "^4.3.1",
"@angular/upgrade": "^4.3.1",
"bootstrap": "3.3.7",
"core-js": "2.4.1",
"lodash": "4.17.4",
"pixi.js": "4.5.4",
"reflect-metadata": "0.1.10",
"rxjs": "^5.4.2",
"systemjs": "0.20.17",
"three": "0.86.0",
"zone.js": "0.8.14"
},
"devDependencies": {
"@types/chai": "^4.0.1",
"@types/jquery": "3.2.9",
"@types/lodash": "4.14.71",
"@types/mocha": "2.2.41",
"@types/pixi.js": "4.5.2",
"@types/three": "0.84.19",
"bower": "^1.8.0",
"gulp": "3.9.1",
"gulp-clean": "^0.3.2",
"gulp-concat": "^2.6.1",
"gulp-typescript": "^3.2.1",
"gulp-inline-ng2-template": "^4.0.0",
"gulp-sourcemaps": "^2.6.0",
"gulp-tsc": "^1.3.2",
"gulp-uglify": "^3.0.0",
"merge2": "^1.1.0",
"path": "^0.12.7",
"rimraf": "^2.6.1",
"systemjs-builder": "^0.16.9",
"typescript": "2.4.1"
},
"scripts": {
"gulp": "gulp",
"rimraf": "rimraf",
"bundle": "gulp bundle",
"postbundle": "rimraf dist"
}
}
कैसे यह है कि "iterable" हो सकता है उन सभी lib समावेशन के बाद नहीं मिला है? टाइपस्क्रिप्ट कंपाइलर मेरे tsconfig.json को अनदेखा नहीं करता है क्योंकि कुछ विकल्प बदलना विभिन्न आउटपुट देता है, लेकिन त्रुटियों के बिना कोई नहीं।
मेरा पर्यावरण विजुअल स्टूडियो 2015 अपडेट 3 टाइपस्क्रिप्ट टूल 2.4.1 के साथ है। मैं एनपीएन @ टाइप्स (कोई टाइपिंग) का उपयोग कर रहा हूं। वर्बोज़ संकलन आउटपुट से पता चलता है कि विजुअल स्टूडियो प्रभावी रूप से 2.4.1 संस्करण का उपयोग करता है।
और सबसे विचित्र बात यह है कि गल्प का उपयोग करके संकलन एक ही टाइपस्क्रिप्ट संस्करण और tsconfig का उपयोग करके कोई त्रुटि नहीं देता है।
आप सुनिश्चित करें कि आप कहीं और अपने ऐप्लिकेशन में अनावश्यक tsconfig.json या tsconfig.app.json फ़ाइल है कि एक या उन में से अधिक अधिलेखन है की जरूरत नहीं है सेटिंग्स? एक बार मेरे साथ हुआ ... – diopside
हां। अंततः मैंने टाइपस्क्रिप्ट को अपग्रेड किए बिना वीएस2017 (जिसे मैं शुरू में नहीं चाहता था) पर कूद गया और सब कुछ ठीक है। –