過去兩個月,我一直在使用Angular2 Nativescript應用程序......上一次我在這個項目上工作的時間大概是一週前,所有編譯時沒有任何問題,然後現在當我嘗試構建並在genymotion模擬器上運行應用程序時,出現以下錯誤。任何想法爲什麼發生這種情況?它似乎與我從未碰過的節點模塊有關......前幾天我在重新安裝angular-cli時清除了npm緩存,不確定這是否會導致這種情況?Angular2/Nativescript:嘗試構建/運行時出現奇怪的模糊錯誤任何項目
更新: 我試圖運行nativescript樣品雜貨應用程序,並得到了確切的同樣的錯誤,所以我敢肯定,這關係到我的Nativescript安裝...我試圖卸載nativescript與NPM卸載-g nativescript然後NPM明確緩存。然後我重新安裝了npm install -g nativescript @ latest但是仍然沒有改變當我試圖運行任何nativescript項目時,我得到了完全相同的錯誤...我使用Nativescript 2.4.1 ...
在Windows中我的整個輸入/輸出命令提示符:
C:\Users\User1\Documents\nativescript\barcode-scanner>tns run android --geny "nexus" --watch
Executing before-prepare hook from C:\Users\User1\Documents\nativescript\barcode-scanner\hooks\before-prepare\nativescript-dev-android-snapshot.js Executing before-prepare hook from C:\Users\Deon\Documents\nativescript\barcode-scanner\hooks\before-prepare\nativescript-dev-typescript.js Found peer TypeScript 2.0.10
node_modules/tns-core-modules/es-collections.d.ts(30,14): error TS2300: Duplicate identifier 'MapConstructor'.
node_modules/tns-core-modules/es-collections.d.ts(31,14): error TS2300: Duplicate identifier 'SetConstructor'.
../../node_modules/@types/node/index.d.ts(38,11): error TS2300: Duplicate identifier 'MapConstructor'.
../../node_modules/@types/node/index.d.ts(40,11): error TS2300: Duplicate identifier 'SetConstructor'.
../../node_modules/@types/node/index.d.ts(49,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'global' must be of type 'any', but here has type 'Global'. ../../node_modules/@types/node/index.d.ts(73,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'require' must be of type 'NativeScriptRequire', but here has type 'NodeRequire'. ../../node_modules/@types/node/index.d.ts(85,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'module' must be of type 'NativeScriptModule', but here has type 'NodeModule'. ../../node_modules/@types/node/index.d.ts(3993,5): error TS2309: An export assignment cannot be used in a module with other exported elements. TypeScript compiler failed with exit code 1