Webpack-dev-server找不到模块

欢迎,

我是React和Node.js的新手。 我想学习一些关于React的知识,并最终与Node.js一起苦苦挣扎。 问题是我无法正确设置Web开发服务器。 对不起,如果这个问题似乎trival虽然我还没有find一个小时的解决scheme。

这里是: webpack.config.js

module.exports = { entry: './src/index.js', output: { path: __dirname, filename: 'app/js/main.js' }, module: { loaders: [{ test: /\.jsx?$/, loader: 'babel', exclude: /node_modules/ }] } } 

的package.json

 { "name": "Github_profile_viewer", "version": "0.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "BSD", "devDependencies": { "babel-core": "5.8.*", "babel-loader": "5.3.*", "webpack": "1.12.*", "webpack-dev-server": "1.10.*" }, "dependencies": { "react": "^0.14,7", "react-dom": "^0.14.7" } } 

HTTP://本地主机:8080 /应用/ JS / main.js

 /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { (function webpackMissingModule() { throw new Error("Cannot find module \"./src/index.js\""); }()); /***/ } /******/ ]); 

当我尝试build立webpack-dev-server: CMD错误时,我也会收到这样的警告

唉,我已经npm installed了所需的模块npm installed (至less它应该是这样)。

我不知道我必须做什么使其工作:(

看起来应该通过npm install来包含lodash,但是webpack-dev-server找不到它:

npm安装

这是一个caching错误或类似的东西。 快速解决scheme可能是:

 rm -rf node_modules rm -rf ~/.npm npm install -g npm npm install