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
Node.js 无法将reactjs的webpack 1.5.2更新为webpack 2.0.0_Node.js_Reactjs_Visual Studio 2015_Webpack - Fatal编程技术网

Node.js 无法将reactjs的webpack 1.5.2更新为webpack 2.0.0

Node.js 无法将reactjs的webpack 1.5.2更新为webpack 2.0.0,node.js,reactjs,visual-studio-2015,webpack,Node.js,Reactjs,Visual Studio 2015,Webpack,我正在使用VS2015、React.js和webpack。我已经安装了所有的软件包。但我的系统中有默认的Webpack1.5.2。我正在尝试更新Webpack2.0.0,但它不允许我更新该软件包。它给出如下错误: 下面是webpack.config.js文件的代码 var path = require('path'); var ExtractTextPlugin = require("extract-text-webpack-plugin"); var webpack = require('w

我正在使用VS2015、React.js和webpack。我已经安装了所有的软件包。但我的系统中有默认的Webpack1.5.2。我正在尝试更新Webpack2.0.0,但它不允许我更新该软件包。它给出如下错误:

下面是webpack.config.js文件的代码

var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var webpack = require('webpack');

module.exports = {
    entry: ['./src/app.js'],
    output: {
        path: path.resolve(__dirname, 'build'),
        filename: 'appBundle.js'
    },
    module: {
        loaders: [
            { test: /\.png$/, loader: "url-loader?limit=100000" },
            { test: /\.jpg$/, loader: "file-loader" },
            { test: /\.jpeg$/, loader: "file-loader" },
            { test: /\.gif$/, loader: "file-loader" },
            { test: /\.txt$/, loader: "raw-loader" },
            { test: /\.json$/, loader: "json-loader" },
            { test: /.(woff(2)?|eot|ttf|svg)(\?[a-z0-9=\.]+)?$/, loader: 'url-loader?limit=100000' },
            { test: /\.css$/,loader: ExtractTextPlugin.extract("style-loader", "css-loader")
        }, {
            loader: 'babel-loader',
            exclude: /node_modules/,
            test: /\.js$/,
            query: {
                presets: ['es2015', 'react', 'stage-0'],
            },
        }]
    },
    plugins: [
        new ExtractTextPlugin("style.css", {
            allChunks: true
        }),
        new webpack.OldWatchingPlugin()
    ]
};
下面是package.json的代码

{


您可以尝试使用以下命令。它将安装最新稳定版本的webpack

npm install --save-dev webpack@2.2.1
此外,您可能希望从命令行或在
package.json
文件中轻松检查网页包版本

npm view webpack version

您可以尝试使用以下命令。它将安装最新稳定版本的webpack

npm install --save-dev webpack@2.2.1
此外,您可能希望从命令行或在
package.json
文件中轻松检查网页包版本

npm view webpack version

你在<代码>依赖项<代码>和<代码>依赖项<代码>中有网页-你应该只有后者。不确定,但你看到问题了吗?你在<代码>依赖项<代码>和<代码>依赖项<代码>中有网页-你应该只有后者。不确定,但你看到问题了吗?我试过那个命令,但我有版本n 1.5.2.如果您有其他方法,请告诉我。
npm卸载--保存开发人员网页
然后运行回答中的命令我尝试了该命令,但我得到了版本1.5.2。如果您有其他方法,请告诉我。
npm卸载--保存开发人员网页
,然后运行该命令答案是什么