> webpack-dev-server -d --config webpack.dev.config.js --content-base public/ --progress --colors


sh: webpack-dev-server: command not found


npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "run" "devserve"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! Blabber@0.0.1 devserve: `webpack-dev-server -d --config webpack.dev.config.js --content-base public/ --progress --colors`
npm ERR! spawn ENOENT

var config = require('./webpack.config.js');
var webpack = require('webpack');


config.plugins.push(
new webpack.DefinePlugin({
"process.env": {
"NODE_ENV": JSON.stringify("development")
}
})
);


module.exports = config;
213756 次浏览

npm install webpack-dev-server -g


$ npm install webpack-dev-server -g


  "scripts": {
"start": "webpack-dev-server -d --config webpack.dev.config.js --content-base public/ --progress --colors"
}

$ npm start

$ yarn start

sudo npm install -g webpack-dev-server

./node_modules/webpack-dev-server/bin/webpack-dev-server.js -d --config webpack.dev.config.js --content-base public/ --progress --colors

npm install --save-dev babel-loader url-loader webpack webpack-cli webpack-dev-server --legacy-peer-deps