Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/25.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
Node.js 安装reactJS时遇到问题_Node.js_Reactjs_Npm - Fatal编程技术网

Node.js 安装reactJS时遇到问题

Node.js 安装reactJS时遇到问题,node.js,reactjs,npm,Node.js,Reactjs,Npm,使用以下指南安装reactJS时遇到问题: 我正在使用: npm 4.2.0 节点7.10.0 Red Hat Enterprise Linux Server 7.2版(Maipo) 这就是我得到的错误: [root@webdev2 reactJSApp]# npm start > test@1.0.0 start /opt/swtapps/reactJSApp > webpack-dev-server --hot ✖ 「wds」: Invalid configuration

使用以下指南安装reactJS时遇到问题:

我正在使用: npm 4.2.0 节点7.10.0 Red Hat Enterprise Linux Server 7.2版(Maipo)

这就是我得到的错误:

[root@webdev2 reactJSApp]# npm start

> test@1.0.0 start /opt/swtapps/reactJSApp
> webpack-dev-server --hot

✖ 「wds」: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.module has an unknown property 'loaders'. These properties are valid:
   object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, defaultRules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp?, strictExportPresence?, strictThisContextOnImports? }
   -> Options affecting the normal modules (`NormalModuleFactory`).

npm ERR! Linux 3.10.0-327.10.1.el7.x86_64
npm ERR! argv "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "start"
npm ERR! node v7.10.1
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test@1.0.0 start: `webpack-dev-server --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test@1.0.0 start script 'webpack-dev-server --hot'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack-dev-server --hot
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs test
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls test
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/.npm/_logs/2018-07-16T19_07_33_854Z-debug.log

有什么建议吗?

教程已经过时了。Webpack 4中的加载程序定义为:

module: {
  rules: [
    {
      test: /\.jsx?$/,
      // options for the loader
    },
  ],
}
我建议您阅读有关这些问题的教程。

这是一本老教程。