账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    Error: Cannot find module 'webpack'
    19
    0

    运行

    npm start

    报错

    Error: Cannot find module 'webpack'

    安装了

    npm install --save-dev webpack
    cnpm install webpack-dev-server -g

    解决不了问题,怎么办?

    最后副一条我的package.json

    {
      "name": "webpack",
      "version": "1.0.0",
      "description": "vue+webapck",
      "main": "index.js",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "start": "webpack-dev-server --inline"
      },
      "author": "",
      "license": "ISC",
      "devDependencies": {
        "autoprefixer-loader": "^2.0.0",
        "babel": "^6.3.13",
        "babel-core": "^6.3.21",
        "babel-loader": "^6.2.0",
        "babel-plugin-transform-runtime": "^6.3.13",
        "babel-preset-es2015": "^6.3.13",
        "babel-runtime": "^5.8.34",
        "css-loader": "^0.16.0",
        "file-loader": "^0.8.5",
        "html-loader": "^0.3.0",
        "node-sass": "^3.4.2",
        "sass-loader": "^3.2.0",
        "style-loader": "^0.12.3",
        "url-loader": "^0.5.6",
        "vue-html-loader": "^1.2.0",
        "vue-loader": "^7.2.0",
        "webpack": "^1.15.0",
        "webpack-dev-server": "^1.14.0"
      },
      "keywords": [
        "vue",
        "webpack"
      ]
    }
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 我本无情 普通会员 1楼

      This error message usually indicates that the module you are trying to import, webpack, is not installed in your project. Here are some steps you can take to resolve this issue:

      1. Check if webpack is installed: You can use the npm command to check if webpack is installed in your project. Open a terminal window and run the following command:

      npm ls webpack

      If webpack is installed, it should return the path to the installed module.

      1. Install webpack: If webpack is not installed, you can install it using the following command:

      npm install webpack

      1. Verify that webpack is installed: After installing webpack, you can verify that it is installed by running the following command:

      webpack --version

      If webpack is installed, it should return the version number.

      If you have already tried these steps and are still getting the error message, it's possible that there is a configuration issue with your webpack configuration file. You can try opening the webpack configuration file in a text editor and making sure that all the required dependencies are installed and that the correct paths to the dependencies are specified.

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部