Javascript node#u modules/@types/node/globals.d.ts:错误TS2451:无法重新声明块作用域变量';控制台';
我只是按照下面链接上的说明创建了一个支持Javascript node#u modules/@types/node/globals.d.ts:错误TS2451:无法重新声明块作用域变量';控制台';,javascript,node.js,typescript,react-native,expo,Javascript,Node.js,Typescript,React Native,Expo,我只是按照下面链接上的说明创建了一个支持TypeScript的React Native应用程序 我的问题是,当我运行:$tsc时,我得到以下错误: $ tsc > react-native-typescript@0.1.0 tsc D:\react-native-typescript > tsc node_modules/@types/node/globals.d.ts(164,13): error TS2451: Cannot redeclare block-scoped v
TypeScript
的React Native
应用程序
我的问题是,当我运行:$tsc
时,我得到以下错误:
$ tsc
> react-native-typescript@0.1.0 tsc D:\react-native-typescript
> tsc
node_modules/@types/node/globals.d.ts(164,13): error TS2451: Cannot redeclare block-scoped variable 'console'.
node_modules/@types/node/globals.d.ts(217,13): error TS2300: Duplicate identifier 'require'.
node_modules/@types/react-native/globals.d.ts(92,14): error TS2300: Duplicate identifier 'RequestInfo'.
node_modules/@types/react-native/index.d.ts(8885,14): error TS2300: Duplicate identifier 'require'.
node_modules/@types/react-native/index.d.ts(8903,11): error TS2451: Cannot redeclare block-scoped variable 'console'.
node_modules/@types/react-native/index.d.ts(8911,18): error TS2717: Subsequent property declarations must have the same type. Property 'geolocation' must be of type 'Geolocation', but here has type 'GeolocationStatic'.
node_modules/@types/react-native/index.d.ts(8914,11): error TS2451: Cannot redeclare block-scoped variable 'navigator'.
node_modules/typescript/lib/lib.dom.d.ts(15764,13): error TS2451: Cannot redeclare block-scoped variable 'navigator'.
node_modules/typescript/lib/lib.dom.d.ts(15940,13): error TS2451: Cannot redeclare block-scoped variable 'console'.
node_modules/typescript/lib/lib.dom.d.ts(15997,6): error TS2300: Duplicate identifier 'RequestInfo'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! react-native-typescript@0.1.0 tsc: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the react-native-typescript@0.1.0 tsc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Bill\AppData\Roaming\npm-cache\_logs\2019-02-17T17_20_46_096Z-debug.log
问题似乎出在节点_modules
目录中的包上,而不是我的实际代码上
你知道如何使$tsc
的结果保持干净吗
谢谢
npm过时
是否显示任何过时的内容?