Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在课堂练习 MobX 一节执行 npm start 报错 #31

Closed
shaojunda opened this issue Feb 10, 2017 · 3 comments
Closed

在课堂练习 MobX 一节执行 npm start 报错 #31

shaojunda opened this issue Feb 10, 2017 · 3 comments

Comments

@shaojunda
Copy link
Contributor

shaojunda commented Feb 10, 2017

代码是最新的
系统环境:macOS Sierra 10.12
nodejs: v7.5.0
npm: 4.1.2
删除 node_modules 重新执行 npm install 之后依然报错。
错误信息如下:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.entry should be one of these:
   object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string] | function
   The entry point(s) of the compilation.
   Details:
    * configuration.entry should be an object.
    * configuration.entry should be a string.
    * configuration.entry should NOT have duplicate items (items ## 1 and 2 are identical) ({
        "keyword": "uniqueItems",
        "dataPath": ".entry",
        "schemaPath": "#/definitions/common.nonEmptyArrayOfUniqueStringValues/uniqueItems",
        "params": {
          "i": 2,
          "j": 1
        },
        "message": "should NOT have duplicate items (items ## 1 and 2 are identical)",
        "schema": true,
        "parentSchema": {
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "minItems": 1,
          "type": "array",
          "uniqueItems": true
        },
        "data": [
          "/Users/dennis/apps/jstraining/demos/mobx-demo/node_modules/webpack-dev-server/client/index.js?http://localhost:8080",
          "webpack/hot/dev-server",
          "webpack/hot/dev-server",
          "webpack-dev-server/client?http://localhost:8080",
          "/Users/dennis/apps/jstraining/demos/mobx-demo/app/main.jsx"
        ]
      }).
      [non-empty string]
    * configuration.entry should be an instance of function
      function returning an entry object or a promise..
 - configuration.resolve.extensions[0] should not be empty.

npm ERR! Darwin 16.0.0
npm ERR! argv "/Users/dennis/.nvm/versions/node/v7.5.0/bin/node" "/Users/dennis/.nvm/versions/node/v7.5.0/bin/npm" "start"
npm ERR! node v7.5.0
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! mobx-demo@1.0.0 start: `webpack-dev-server --devtool eval --progress --hot --content-base app`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mobx-demo@1.0.0 start script 'webpack-dev-server --devtool eval --progress --hot --content-base app'.
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 mobx-demo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack-dev-server --devtool eval --progress --hot --content-base app
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs mobx-demo
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls mobx-demo
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dennis/apps/jstraining/demos/mobx-demo/npm-debug.log
@shaojunda
Copy link
Contributor Author

@ruanyf

@ruanyf
Copy link
Owner

ruanyf commented Feb 11, 2017

已经修改好了,请执行下面命令。

$ git pull
$ cd demos/mobx-demo
$ rm -rf node_modules
$ npm install
$ npm start

主要原因是 Webpack 升级到了 2.x 版,导致原有的配置文件不兼容。

@ruanyf ruanyf closed this as completed Feb 11, 2017
@shaojunda
Copy link
Contributor Author

可以了,多谢 @ruanyf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants