首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何修复参数数量不足或找不到条目的问题。或者,运行'webpack(-cli) --帮助‘获取用法信息

如何修复参数数量不足或找不到条目的问题。或者,运行'webpack(-cli) --帮助‘获取用法信息
EN

Stack Overflow用户
提问于 2019-03-31 13:43:41
回答 1查看 27.7K关注 0票数 10

当我运行命令npm run dev时,我得到了错误Insufficient number of arguments or no entry found. Alternatively, run 'webpack(-cli) --help' for usage info.,在这个命令下,我也收到了一个错误,后面跟着一个路径,写着ERROR in Entry module not found: Error: Can't resolve。我不太确定为什么它找不到入口点,任何帮助都会非常感谢。

已将整个项目上传到github,以帮助实现可见性。https://github.com/dustinm94/coding-challenge

webpack.config.js

代码语言:javascript
复制
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader"
        }
      }
    ]
  }
}

package.json

代码语言:javascript
复制
{
  "name": "coding_challenge",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "webpack --mode development --watch ./coding/frontend/src/index.js --output ./coding/frontend/static/frontend/main.js",
    "build": "webpack --mode production ./coding/frontend/src/index.js --output ./coding/frontend/static/frontend/main.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.4.0",
    "@babel/preset-env": "^7.4.2",
    "@babel/preset-react": "^7.0.0",
    "babel-loader": "^8.0.5",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "webpack": "^4.29.6",
    "webpack-cli": "^3.3.0"
  },
  "dependencies": {
    "babel-preset-react": "^6.24.1",
    "prop-types": "^15.7.2",
    "react": "^16.8.6",
    "react-dom": "^16.8.6"
  }
}

.babelrc

代码语言:javascript
复制
{
  "presets": ["@babel/preset-env", "@babel/preset-react"],
  "plugins": ["transform-class-properties"]
}
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55438230

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档