Thursday, 11 May 2017

I get an error when I run Reactjs project from command line: npm run it

Failed at the reactjs@1.0.0 it script 'webpack-dev-server'. Make sure you have the latest version of node.js and npm installed. If you do, this is most likely a problem with the reactjs package, not with npm itself. Tell the author that this fails on your system: webpack-dev-server You can get information on how to open an issue for this project with:npm bugs reactjs Or if that isn't available, you can get their info via: npm owner ls reactjs There is likely additional logging output above.

npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! reactjs@1.0.0 it: `webpack-dev-server`
npm ERR! Exit status 1

My Webpack.config.js

var path = require("webpack");


module.exports = {
  entry: "./script.js",
  output: {
    path: path.resolve(__dirname, + "/build"),
    filename: "index.js"
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: "babel-loader",
        exclude: /node_modules/,
        query: {
          presets: ["es2015", "react"]
        }
      }
    ]
  }

}

package.json

{
  "name": "reactjs",
  "version": "1.0.0",
  "description": "Starter kit for React course by Jack",
  "main": "index.js",
  "scripts": {
    "it": "webpack-dev-server", "<----- something wrong here"
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "VladBelo",
  "license": "ISC",
  "devDependencies": {
    "babel-core": "^6.24.0",
    "babel-loader": "^6.4.1",
    "babel-preset-es2015": "^6.24.0",
    "babel-preset-react": "^6.23.0",
    "eslint": "^3.19.0",
    "eslint-plugin-react": "^7.0.0",
    "webpack": "^2.4.2"
  },
  "dependencies": {
    "react": "^15.4.2",
    "react-dom": "^15.4.2"
  }

}



via alexhacki

No comments:

Post a Comment