Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/414.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/24.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.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 React styleguidist ReferenceError:未定义进程_Javascript_Reactjs_Webpack - Fatal编程技术网

Javascript React styleguidist ReferenceError:未定义进程

Javascript React styleguidist ReferenceError:未定义进程,javascript,reactjs,webpack,Javascript,Reactjs,Webpack,我将react styleguidist添加到我的项目中。现在,在运行npm run styleguidist时,发生了一个错误ReferenceError:未定义进程 My styleguide.config.js: module.exports = { title: 'Style Guide', pagePerSection: true, sections: [{ name: 'components', section

我将react styleguidist添加到我的项目中。现在,在运行npm run styleguidist时,发生了一个错误ReferenceError:未定义进程

My styleguide.config.js:

module.exports = {
    title: 'Style Guide',
    pagePerSection: true,

    sections: [{
            name: 'components',
            sectionDepth: 1,
            components: './src/components/button.jsx'
        },

    ],

}


考虑到您没有添加任何关于设置的解释,我将在回答中做出许多假设。 您使用的是哪个版本的网页包?我认为它可能与v5有关,因为它不再使用进程依赖关系,而
styleguidist
仍然依赖v4,而v4确实如此

您可以通过更新您的网页配置暂时解决此问题:

plugins:[
  new webpack.DefinePlugin({
    process: { env: {} }
  })
]

此代码段中的
process
在哪里?在我的webpack.config.js中