首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Angular2/Nativescript:尝试构建/运行任何项目时出现奇怪的模糊错误

Angular2/Nativescript:尝试构建/运行任何项目时出现奇怪的模糊错误
EN

Stack Overflow用户
提问于 2017-01-24 19:57:27
回答 1查看 138关注 0票数 0

在过去的两个月里,我一直在开发一个Angular2原生脚本应用程序……我上一次在这个项目上工作是在大约一周前,所有的编译都没有任何问题,现在当我尝试在genymotion模拟器上构建并运行应用程序时,我得到了以下错误。你知道为什么会发生这种事吗?它似乎与我从未接触过的节点模块有关……几天前,我在重新安装angular-cli时清除了npm缓存,不确定这是不是以某种方式导致的?

更新:我尝试运行nativescript sample-groceries应用程序,得到了完全相同的错误,所以我确定它与我的Nativescript安装有关……我尝试用npm卸载nativescript,卸载-g nativescript,然后npm清除缓存。然后我用npm install -g nativescript@latest重新安装,但仍然没有变化,当我尝试运行任何nativescript项目时,我得到了完全相同的错误...我使用的是Nativescript 2.4.1...

我在windows命令提示符中的整个输入/输出:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2017-01-25 06:18:19

所以问题是我的Typescript版本安装在本地Nativescript应用程序的node_modules中……任何2.0.2以上的版本都会出现这个问题。<= 2.0.2构建没有任何问题。我将接受任何可以解释这一点的答案,否则我将在另一个问题中继续“为什么”……

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41827669

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档