新创建的React Native项目存在流错误

时间:2016-12-20 16:00:09

标签: javascript react-native flowtype

让我们先解决这个问题:

drew.wyatt$ react-native --version
react-native-cli: 2.0.1
react-native: 0.39.2

drew.wyatt$ flow version
Flow, a static type checker for JavaScript, version 0.35.0

它的长短之处在于,我在使用React Native CLI创建的全新项目中出现流错误。

我有一个奇怪的版本不匹配或什么?

这是最近的输出:

Drew-Wyatt:Projects drew.wyatt$ react-native init Whatever
This will walk you through creating a new React Native project in /Users/drew.wyatt/Projects/Whatever
Using yarn v0.16.1
Installing react-native...
yarn add v0.16.1
info No lockfile found.
[1/4]   Resolving packages...
warning react-native > xcode > node-uuid@1.4.7: use uuid module instead
[2/4]   Fetching packages...
[3/4]   Linking dependencies...
warning Unmet peer dependency "react@~15.4.0-rc.4".
[4/4]   Building fresh packages...
success Saved lockfile.
success Saved 466 new dependencies.
├─ absolute-path@0.0.0
├─ accepts@1.2.13
│  ├─ mime-db@1.25.0
│  └─ mime-types@2.1.13
├─ align-text@0.1.4
├─ ansi-escapes@1.4.0
├─ ansi-regex@2.0.0
├─ ansi-styles@2.2.1
├─ ansi@0.3.1
├─ are-we-there-yet@1.1.2
├─ array-differ@1.0.0
├─ array-filter@0.0.1
├─ array-find-index@1.0.2
├─ array-map@0.0.0
├─ array-reduce@0.0.0
├─ array-union@1.0.2
├─ array-uniq@1.0.3
├─ arrify@1.0.1
├─ art@0.10.1
├─ asap@2.0.5
├─ async@2.1.4
├─ babel-code-frame@6.20.0
├─ babel-core@6.21.0
│  └─ json5@0.5.1
├─ babel-generator@6.21.0
├─ babel-helper-builder-react-jsx@6.21.1
├─ babel-helper-call-delegate@6.18.0
├─ babel-helper-define-map@6.18.0
├─ babel-helper-function-name@6.18.0
├─ babel-helper-get-function-arity@6.18.0
├─ babel-helper-hoist-variables@6.18.0
├─ babel-helper-optimise-call-expression@6.18.0
├─ babel-helper-regex@6.18.0
├─ babel-helper-replace-supers@6.18.0
├─ babel-helpers@6.16.0
├─ babel-messages@6.8.0
├─ babel-plugin-check-es2015-constants@6.8.0
├─ babel-plugin-external-helpers@6.18.0
├─ babel-plugin-react-transform@2.0.2
├─ babel-plugin-syntax-async-functions@6.13.0
├─ babel-plugin-syntax-class-properties@6.13.0
├─ babel-plugin-syntax-flow@6.18.0
├─ babel-plugin-syntax-jsx@6.18.0
├─ babel-plugin-syntax-object-rest-spread@6.13.0
├─ babel-plugin-syntax-trailing-function-commas@6.20.0
├─ babel-plugin-transform-class-properties@6.19.0
├─ babel-plugin-transform-es2015-arrow-functions@6.8.0
├─ babel-plugin-transform-es2015-block-scoped-functions@6.8.0
├─ babel-plugin-transform-es2015-block-scoping@6.21.0
├─ babel-plugin-transform-es2015-classes@6.18.0
├─ babel-plugin-transform-es2015-computed-properties@6.8.0
├─ babel-plugin-transform-es2015-destructuring@6.19.0
├─ babel-plugin-transform-es2015-for-of@6.18.0
├─ babel-plugin-transform-es2015-function-name@6.9.0
├─ babel-plugin-transform-es2015-literals@6.8.0
├─ babel-plugin-transform-es2015-modules-commonjs@6.18.0
├─ babel-plugin-transform-es2015-object-super@6.8.0
├─ babel-plugin-transform-es2015-parameters@6.21.0
├─ babel-plugin-transform-es2015-shorthand-properties@6.18.0
├─ babel-plugin-transform-es2015-spread@6.8.0
├─ babel-plugin-transform-es2015-sticky-regex@6.8.0
├─ babel-plugin-transform-es2015-template-literals@6.8.0
├─ babel-plugin-transform-es2015-unicode-regex@6.11.0
├─ babel-plugin-transform-es3-member-expression-literals@6.8.0
├─ babel-plugin-transform-es3-property-literals@6.8.0
├─ babel-plugin-transform-flow-strip-types@6.21.0
├─ babel-plugin-transform-object-assign@6.8.0
├─ babel-plugin-transform-object-rest-spread@6.20.2
├─ babel-plugin-transform-react-display-name@6.8.0
├─ babel-plugin-transform-react-jsx-source@6.9.0
├─ babel-plugin-transform-react-jsx@6.8.0
├─ babel-plugin-transform-regenerator@6.21.0
├─ babel-plugin-transform-strict-mode@6.18.0
├─ babel-polyfill@6.20.0
│  └─ regenerator-runtime@0.10.1
├─ babel-preset-es2015-node@6.1.1
├─ babel-preset-fbjs@2.1.0
├─ babel-preset-react-native@1.9.1
├─ babel-register@6.18.0
├─ babel-runtime@6.20.0
│  └─ regenerator-runtime@0.10.1
├─ babel-template@6.16.0
├─ babel-traverse@6.21.0
├─ babel-types@6.21.0
├─ babylon@6.14.1
├─ balanced-match@0.4.2
├─ base64-js@1.2.0
├─ base64-url@1.2.1
├─ basic-auth-connect@1.0.0
├─ basic-auth@1.0.4
├─ batch@0.5.3
├─ beeper@1.1.1
├─ body-parser@1.13.3
│  ├─ debug@2.2.0
│  ├─ iconv-lite@0.4.11
│  └─ ms@0.7.1
├─ bplist-creator@0.0.4
├─ bplist-parser@0.0.6
├─ brace-expansion@1.1.6
├─ bser@1.0.2
├─ buffer-shims@1.0.0
├─ builtin-modules@1.1.1
├─ bytes@2.1.0
├─ camelcase-keys@2.1.0
│  └─ camelcase@2.1.1
├─ camelcase@3.0.0
├─ center-align@0.1.3
├─ chalk@1.1.3
├─ cli-cursor@1.0.2
├─ cli-width@2.1.0
├─ cliui@3.2.0
├─ clone-stats@0.0.1
├─ clone@1.0.2
├─ code-point-at@1.1.0
├─ commander@2.9.0
├─ compressible@2.0.9
│  └─ mime-db@1.25.0
├─ compression@1.5.2
│  ├─ debug@2.2.0
│  └─ ms@0.7.1
├─ concat-map@0.0.1
├─ connect-timeout@1.6.2
│  ├─ debug@2.2.0
│  └─ ms@0.7.1
├─ connect@2.30.2
│  ├─ debug@2.2.0
│  └─ ms@0.7.1
├─ content-type@1.0.2
├─ convert-source-map@1.3.0
├─ cookie-parser@1.3.5
├─ cookie-signature@1.0.6
├─ cookie@0.1.3
├─ core-js@2.4.1
├─ core-util-is@1.0.2
├─ crc@3.3.0
├─ cross-spawn@3.0.1
├─ csrf@3.0.4
│  ├─ base64-url@1.3.3
│  └─ uid-safe@2.1.3
├─ csurf@1.8.3
├─ currently-unhandled@0.4.1
├─ dateformat@1.0.12
├─ debug@2.4.5
├─ decamelize@1.2.0
├─ delegates@1.0.0
├─ denodeify@1.2.1
├─ depd@1.0.1
├─ destroy@1.0.4
├─ detect-indent@4.0.0
├─ dom-walk@0.1.1
├─ duplexer2@0.0.2
│  ├─ isarray@0.0.1
│  └─ readable-stream@1.1.14
├─ ee-first@1.1.1
├─ encoding@0.1.12
├─ errno@0.1.4
├─ error-ex@1.3.0
├─ errorhandler@1.4.3
│  ├─ accepts@1.3.3
│  ├─ mime-db@1.25.0
│  ├─ mime-types@2.1.13
│  └─ negotiator@0.6.1
├─ escape-html@1.0.3
├─ escape-string-regexp@1.0.5
├─ esutils@2.0.2
├─ etag@1.7.0
├─ event-target-shim@1.1.1
├─ exec-sh@0.2.0
├─ exit-hook@1.1.1
├─ express-session@1.11.3
│  ├─ debug@2.2.0
│  └─ ms@0.7.1
├─ fancy-log@1.2.0
├─ fb-watchman@1.9.0
├─ fbjs-scripts@0.7.1
│  ├─ babel-preset-fbjs@1.0.0
│  └─ core-js@1.2.7
├─ fbjs@0.8.7
│  └─ core-js@1.2.7
├─ figures@1.7.0
├─ finalhandler@0.4.0
│  ├─ debug@2.2.0
│  ├─ escape-html@1.0.2
│  └─ ms@0.7.1
├─ find-up@1.1.2
├─ fresh@0.3.0
├─ fs-extra@0.26.7
├─ fs.realpath@1.0.0
├─ gauge@1.2.7
├─ get-caller-file@1.0.2
├─ get-stdin@4.0.1
├─ glob@5.0.15
├─ global@4.3.1
├─ globals@9.14.0
├─ glogg@1.0.0
├─ graceful-fs@4.1.11
├─ graceful-readlink@1.0.1
├─ gulp-util@3.0.7
│  └─ object-assign@3.0.0
├─ gulplog@1.0.0
├─ has-ansi@2.0.0
├─ has-gulplog@0.1.0
├─ has-unicode@2.0.1
├─ hoek@2.16.3
├─ home-or-tmp@2.0.0
├─ hosted-git-info@2.1.5
├─ http-errors@1.3.1
├─ iconv-lite@0.4.15
├─ image-size@0.3.5
├─ immutable@3.7.6
├─ imurmurhash@0.1.4
├─ indent-string@2.1.0
├─ inflight@1.0.6
├─ inherits@2.0.3
├─ inquirer@0.12.0
├─ invariant@2.2.2
├─ invert-kv@1.0.0
├─ is-arrayish@0.2.1
├─ is-buffer@1.1.4
├─ is-builtin-module@1.0.0
├─ is-finite@1.0.2
├─ is-fullwidth-code-point@1.0.0
├─ is-stream@1.1.0
├─ is-utf8@0.2.1
├─ isarray@1.0.0
├─ isemail@1.2.0
├─ isexe@1.1.2
├─ isomorphic-fetch@2.2.1
│  └─ whatwg-fetch@2.0.1
├─ jest-haste-map@17.0.3
├─ joi@6.10.1
├─ js-tokens@2.0.0
├─ jsesc@1.3.0
├─ json-stable-stringify@1.0.1
├─ json5@0.4.0
├─ jsonfile@2.4.0
├─ jsonify@0.0.0
├─ kind-of@3.1.0
├─ klaw@1.3.1
├─ lazy-cache@1.0.4
├─ lcid@1.0.0
├─ load-json-file@1.1.0
├─ lodash._basecopy@3.0.1
├─ lodash._basetostring@3.0.1
├─ lodash._basevalues@3.0.0
├─ lodash._getnative@3.9.1
├─ lodash._isiterateecall@3.0.9
├─ lodash._reescape@3.0.0
├─ lodash._reevaluate@3.0.0
├─ lodash._reinterpolate@3.0.0
├─ lodash._root@3.0.1
├─ lodash.escape@3.2.0
├─ lodash.isarguments@3.1.0
├─ lodash.isarray@3.0.4
├─ lodash.keys@3.1.2
├─ lodash.pad@4.5.1
├─ lodash.padend@4.6.1
├─ lodash.padstart@4.6.1
├─ lodash.restparam@3.6.1
├─ lodash.template@3.6.2
├─ lodash.templatesettings@3.1.1
├─ lodash@4.17.2
├─ longest@1.0.1
├─ loose-envify@1.3.0
├─ loud-rejection@1.6.0
├─ lru-cache@4.0.2
├─ makeerror@1.0.11
├─ map-obj@1.0.1
├─ media-typer@0.3.0
├─ meow@3.7.0
├─ merge@1.2.0
├─ method-override@2.3.7
│  ├─ debug@2.3.3
│  └─ vary@1.1.0
├─ methods@1.1.2
├─ mime-db@1.23.0
├─ mime-types@2.1.11
├─ mime@1.3.4
├─ min-document@2.19.0
├─ minimatch@3.0.3
├─ minimist@1.2.0
├─ mkdirp@0.5.1
│  └─ minimist@0.0.8
├─ moment@2.17.1
├─ morgan@1.6.1
│  ├─ debug@2.2.0
│  └─ ms@0.7.1
├─ ms@0.7.2
├─ multimatch@2.1.0
├─ multiparty@3.3.2
│  ├─ isarray@0.0.1
│  └─ readable-stream@1.1.14
├─ multipipe@0.1.2
├─ mute-stream@0.0.5
├─ negotiator@0.5.3
├─ node-fetch@1.6.3
├─ node-int64@0.4.0
├─ node-uuid@1.4.7
├─ normalize-package-data@2.3.5
├─ npmlog@2.0.4
├─ number-is-nan@1.0.1
├─ object-assign@4.1.0
├─ on-finished@2.3.0
├─ on-headers@1.0.1
├─ once@1.4.0
├─ onetime@1.1.0
├─ opn@3.0.3
├─ optimist@0.6.1
│  ├─ minimist@0.0.10
│  └─ wordwrap@0.0.3
├─ options@0.0.6
├─ os-homedir@1.0.2
├─ os-locale@1.4.0
├─ os-tmpdir@1.0.2
├─ parse-json@2.2.0
├─ parseurl@1.3.1
├─ path-exists@2.1.0
├─ path-is-absolute@1.0.1
├─ path-type@1.1.0
├─ pause@0.1.0
├─ pegjs@0.9.0
├─ pify@2.3.0
├─ pinkie-promise@2.0.1
├─ pinkie@2.0.4
├─ plist@1.2.0
│  └─ base64-js@0.0.8
├─ private@0.1.6
├─ process-nextick-args@1.0.7
├─ process@0.5.2
├─ progress@1.1.8
├─ promise@7.1.1
├─ prr@0.0.0
├─ pseudomap@1.0.2
├─ qs@4.0.0
├─ random-bytes@1.0.0
├─ range-parser@1.0.3
├─ raw-body@2.1.7
│  ├─ bytes@2.4.0
│  └─ iconv-lite@0.4.13
├─ react-clone-referenced-element@1.0.1
├─ react-deep-force-update@1.0.1
├─ react-native@0.39.2
├─ react-proxy@1.1.8
├─ react-timer-mixin@0.13.3
├─ react-transform-hmr@1.0.4
├─ read-pkg-up@1.0.1
├─ read-pkg@1.1.0
├─ readable-stream@2.2.2
├─ readline2@1.0.1
├─ rebound@0.0.13
├─ redent@1.0.0
├─ regenerate@1.3.2
├─ regenerator-runtime@0.9.6
├─ regenerator-transform@0.9.8
├─ regexpu-core@2.0.0
├─ regjsgen@0.2.0
├─ regjsparser@0.1.5
│  └─ jsesc@0.5.0
├─ repeat-string@1.6.1
├─ repeating@2.0.1
├─ replace-ext@0.0.1
├─ require-directory@2.1.1
├─ require-main-filename@1.0.1
├─ response-time@2.3.2
│  └─ depd@1.1.0
├─ restore-cursor@1.0.1
├─ right-align@0.1.3
├─ rimraf@2.5.4
│  └─ glob@7.1.1
├─ rndm@1.2.0
├─ run-async@0.1.0
├─ rx-lite@3.1.2
├─ sane@1.4.1
├─ sax@1.1.6
├─ semver@5.3.0
├─ send@0.13.2
│  ├─ debug@2.2.0
│  ├─ depd@1.1.0
│  ├─ ms@0.7.1
│  └─ statuses@1.2.1
├─ serve-favicon@2.3.2
├─ serve-index@1.7.3
│  ├─ debug@2.2.0
│  ├─ mime-db@1.25.0
│  ├─ mime-types@2.1.13
│  └─ ms@0.7.1
├─ serve-static@1.10.3
├─ set-blocking@2.0.0
├─ setimmediate@1.0.5
├─ shell-quote@1.6.1
├─ signal-exit@3.0.2
├─ simple-plist@0.1.4
├─ slash@1.0.0
├─ slide@1.1.6
├─ source-map-support@0.4.6
├─ source-map@0.5.6
├─ sparkles@1.0.0
├─ spdx-correct@1.0.2
├─ spdx-expression-parse@1.0.4
├─ spdx-license-ids@1.2.2
├─ stacktrace-parser@0.1.4
├─ statuses@1.3.1
├─ stream-buffers@0.2.6
├─ stream-counter@0.2.0
│  ├─ isarray@0.0.1
│  └─ readable-stream@1.1.14
├─ string_decoder@0.10.31
├─ string-width@1.0.2
├─ strip-ansi@3.0.1
├─ strip-bom@2.0.0
├─ strip-indent@1.0.1
├─ supports-color@2.0.0
├─ temp@0.8.3
│  └─ rimraf@2.2.8
├─ throat@3.0.0
├─ through@2.3.8
├─ through2@2.0.3
├─ time-stamp@1.0.1
├─ tmpl@1.0.4
├─ to-fast-properties@1.0.2
├─ topo@1.1.0
├─ trim-newlines@1.0.0
├─ tsscmp@1.0.5
├─ type-is@1.6.14
│  ├─ mime-db@1.25.0
│  └─ mime-types@2.1.13
├─ ua-parser-js@0.7.12
├─ uglify-js@2.7.5
│  ├─ async@0.2.10
│  ├─ camelcase@1.2.1
│  ├─ cliui@2.1.0
│  ├─ window-size@0.1.0
│  ├─ wordwrap@0.0.2
│  └─ yargs@3.10.0
├─ uglify-to-browserify@1.0.2
├─ uid-safe@2.0.0
├─ ultron@1.0.2
├─ unpipe@1.0.0
├─ util-deprecate@1.0.2
├─ utils-merge@1.0.0
├─ validate-npm-package-license@3.0.1
├─ vary@1.0.1
├─ vhost@3.0.2
├─ vinyl@0.5.3
├─ walker@1.0.7
├─ watch@0.10.0
├─ whatwg-fetch@1.1.1
├─ which-module@1.0.0
├─ which@1.2.12
├─ window-size@0.2.0
├─ wordwrap@1.0.0
├─ worker-farm@1.3.1
├─ wrap-ansi@2.1.0
├─ wrappy@1.0.2
├─ write-file-atomic@1.2.0
├─ ws@1.1.1
├─ xcode@0.8.9
├─ xmlbuilder@4.0.0
│  └─ lodash@3.10.1
├─ xmldoc@0.4.0
├─ xmldom@0.1.27
├─ xtend@4.0.1
├─ y18n@3.2.1
├─ yallist@2.0.0
├─ yargs-parser@4.2.0
└─ yargs@6.5.0
✨  Done in 7.54s.
Setting up new React Native app in /Users/drew.wyatt/Projects/Whatever
Installing React...
Installing Jest...
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN prefer global marked@0.3.6 should be installed with -g
To run your app on iOS:
   react-native run-ios
   - or -
   Open ios/Whatever.xcodeproj in Xcode
   Hit the Run button
To run your app on Android:
   Have an Android emulator running (quickest way to get started), or a device connected
   react-native run-android
Drew-Wyatt:Projects drew.wyatt$ cd Whatever/
Drew-Wyatt:Whatever drew.wyatt$ flow
Launching Flow server for /Users/drew.wyatt/Projects/Whatever
Spawned flow server (pid=99638)
Logs will go to /private/tmp/flow/zSUserszSdrew.wyattzSProjectszSWhatever.log
node_modules/react-native/local-cli/server/util/inspectorProxy.js:43
 43: const querystring = require('querystring');
                         ^^^^^^^^^^^^^^^^^^^^^^ This modules resolves to "<<PROJECT_ROOT>>/../../node_modules/querystring/package.json", which is outside both your root directory and all of the entries in the [include] section of your .flowconfig. You should either add this directory to the [include] section of your .flowconfig, move your .flowconfig file higher in the project directory tree, or move this package under your Flow root directory.

node_modules/react-native/local-cli/server/util/inspectorProxy.js:43
 43: const querystring = require('querystring');
                         ^^^^^^^^^^^^^^^^^^^^^^ querystring. Required module not found

node_modules/react-native/local-cli/server/util/inspectorProxy.js:45
 45: const parseUrl = require('url').parse;
                      ^^^^^^^^^^^^^^ This modules resolves to "<<PROJECT_ROOT>>/../../node_modules/url/package.json", which is outside both your root directory and all of the entries in the [include] section of your .flowconfig. You should either add this directory to the [include] section of your .flowconfig, move your .flowconfig file higher in the project directory tree, or move this package under your Flow root directory.

node_modules/react-native/local-cli/util/Config.js:13
 13: const assert = require('assert');
                    ^^^^^^^^^^^^^^^^^ This modules resolves to "<<PROJECT_ROOT>>/../../node_modules/assert/package.json", which is outside both your root directory and all of the entries in the [include] section of your .flowconfig. You should either add this directory to the [include] section of your .flowconfig, move your .flowconfig file higher in the project directory tree, or move this package under your Flow root directory.

node_modules/react-native/packager/react-packager/src/Bundler/index.js:14
 14: const assert = require('assert');
                    ^^^^^^^^^^^^^^^^^ This modules resolves to "<<PROJECT_ROOT>>/../../node_modules/assert/package.json", which is outside both your root directory and all of the entries in the [include] section of your .flowconfig. You should either add this directory to the [include] section of your .flowconfig, move your .flowconfig file higher in the project directory tree, or move this package under your Flow root directory.

node_modules/react-native/packager/react-packager/src/JSTransformer/index.js:19
 19: const util = require('util');
                  ^^^^^^^^^^^^^^^ This modules resolves to "<<PROJECT_ROOT>>/../../node_modules/util/package.json", which is outside both your root directory and all of the entries in the [include] section of your .flowconfig. You should either add this directory to the [include] section of your .flowconfig, move your .flowconfig file higher in the project directory tree, or move this package under your Flow root directory.

node_modules/react-native/packager/react-packager/src/Logger/index.js:17
 17: const {EventEmitter} = require('events');
                            ^^^^^^^^^^^^^^^^^ This modules resolves to "<<PROJECT_ROOT>>/../../node_modules/events/package.json", which is outside both your root directory and all of the entries in the [include] section of your .flowconfig. You should either add this directory to the [include] section of your .flowconfig, move your .flowconfig file higher in the project directory tree, or move this package under your Flow root directory.

node_modules/react-native/packager/react-packager/src/node-haste/fastfs.js:17
 17: const {EventEmitter} = require('events');
                            ^^^^^^^^^^^^^^^^^ This modules resolves to "<<PROJECT_ROOT>>/../../node_modules/events/package.json", which is outside both your root directory and all of the entries in the [include] section of your .flowconfig. You should either add this directory to the [include] section of your .flowconfig, move your .flowconfig file higher in the project directory tree, or move this package under your Flow root directory.

node_modules/react-native/packager/react-packager/src/node-haste/index.js:33
 33: const util = require('util');
                  ^^^^^^^^^^^^^^^ This modules resolves to "<<PROJECT_ROOT>>/../../node_modules/util/package.json", which is outside both your root directory and all of the entries in the [include] section of your .flowconfig. You should either add this directory to the [include] section of your .flowconfig, move your .flowconfig file higher in the project directory tree, or move this package under your Flow root directory.


Found 9 errors

有什么想法吗?

0 个答案:

没有答案