Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/377.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 正确解析.flowconfig中的'node_module'_Javascript_Reactjs_Import_Webpack_Flowtype - Fatal编程技术网

Javascript 正确解析.flowconfig中的'node_module'

Javascript 正确解析.flowconfig中的'node_module',javascript,reactjs,import,webpack,flowtype,Javascript,Reactjs,Import,Webpack,Flowtype,我在我的网页包配置中设置了网页包别名: resolve: { extensions: ['.js', '.jsx'], alias: { components: path.resolve(__dirname, 'src/components/'), styles: path.resolve(__dirname, 'src/components/styles/'), utils: path.resolve(__dirname, 'src/ut

我在我的网页包配置中设置了网页包
别名

  resolve: {
    extensions: ['.js', '.jsx'],
    alias: {
      components: path.resolve(__dirname, 'src/components/'),
      styles: path.resolve(__dirname, 'src/components/styles/'),
      utils: path.resolve(__dirname, 'src/utils/')
    }
我也在我的
.flowconfig
中设置了
[options]
来解释这一点(这样我就不会到处都出现
所需的模块未找到
错误):

我得到了旧的错误:

yarn run v0.20.3
$ "/Users/rorysmith/code/gen/node_modules/.bin/flow" 
src/components/Calendar.jsx:4
  4: import _times from 'lodash/times'
                        ^^^^^^^^^^^^^^ lodash/times. Required module not found

src/components/Calendar.jsx:5
  5: import _uniqueId from 'lodash/uniqueId'
                           ^^^^^^^^^^^^^^^^^ lodash/uniqueId. Required module not found

src/components/Calendar.jsx:7
  7: import classNames from 'classnames/bind'
                            ^^^^^^^^^^^^^^^^^ classnames/bind. Required module not found

src/components/Category.jsx:16
 16: import _uniqueId from 'lodash/uniqueId'
                           ^^^^^^^^^^^^^^^^^ lodash/uniqueId. Required module not found

如何解决此问题以使错误不显示?

尝试使用
module.system.node.resolve\u dirname=node\u modules
import _uniqueId from 'lodash/uniqueId'
import classNames from 'classnames/bind'
yarn run v0.20.3
$ "/Users/rorysmith/code/gen/node_modules/.bin/flow" 
src/components/Calendar.jsx:4
  4: import _times from 'lodash/times'
                        ^^^^^^^^^^^^^^ lodash/times. Required module not found

src/components/Calendar.jsx:5
  5: import _uniqueId from 'lodash/uniqueId'
                           ^^^^^^^^^^^^^^^^^ lodash/uniqueId. Required module not found

src/components/Calendar.jsx:7
  7: import classNames from 'classnames/bind'
                            ^^^^^^^^^^^^^^^^^ classnames/bind. Required module not found

src/components/Category.jsx:16
 16: import _uniqueId from 'lodash/uniqueId'
                           ^^^^^^^^^^^^^^^^^ lodash/uniqueId. Required module not found