请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

webpack图片的时候报错?

ERROR in ./src/image/banner1.jpg
Module build failed: Error: emitFile is required from module system
at Object.module.exports (/Users/shenjunwei/mall/doc/mall-fe/node_modules/file-loader/index.js:10:27)
at Object.loader (/Users/shenjunwei/mall/doc/mall-fe/node_modules/url-loader/dist/index.js:76:19)
@ ./~/css-loader!./src/page/index/index.css 7:206-240

正在回答 回答被采纳积分+3

2回答

提问者 北斗神拳1984 2018-11-09 21:19:09

shenjunweideMacBook-Pro:mall-fe shenjunwei$ cat package.json 

{

  "name": "mall-fe",

  "version": "1.0.0",

  "description": "mmall前端代码",

  "main": "index.js",

  "scripts": {

    "test": "echo \"Error: no test specified\" && exit 1"

  },

  "repository": {

    "type": "git",

    "url": "git@gitee.com:shenjw2018/mall-fe.git"

  },

  "author": "shenjw",

  "license": "ISC",

  "devDependencies": {

    "css-loader": "^1.0.1",

    "extract-text-webpack-plugin": "^1.0.1",

    "file-loader": "^0.11.1",

    "html-loader": "^0.5.5",

    "html-webpack-plugin": "^3.2.0",

    "style-loader": "^0.23.1",

    "url-loader": "^1.1.2",

    "webpack": "^1.15.0"

  },

  "dependencies": {}

}

装了,之前没装,提示

 Module build failed: Error: Cannot find module 'file-loader'


0 回复 有任何疑惑可以回复我~
  • Rosen #1
    再查下版本号都对着么,还找不到把代码打包发我看看
    回复 有任何疑惑可以回复我~ 2018-11-10 22:35:56
  • 提问者 北斗神拳1984 回复 Rosen #2
    已经正常了,卸载了之前的版本,按照学习指南里的版本按照后就没问题了。
    回复 有任何疑惑可以回复我~ 2018-11-11 13:44:10
  • Rosen 回复 提问者 北斗神拳1984 #3
    收到!
    回复 有任何疑惑可以回复我~ 2018-11-13 10:54:03
Rosen 2018-11-09 20:50:12

file-loader 没装?看看源代码里的 package.json文件跟你多有什么不一样

0 回复 有任何疑惑可以回复我~
  • 提问者 北斗神拳1984 #1
    shenjunweideMacBook-Pro:mall-fe shenjunwei$ cat package.json 
    {
      "name": "mall-fe",
      "version": "1.0.0",
      "description": "mmall前端代码",
      "main": "index.js",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      },
      "repository": {
        "type": "git",
        "url": "git@gitee.com:shenjw2018/mall-fe.git"
      },
      "author": "shenjw",
      "license": "ISC",
      "devDependencies": {
        "css-loader": "^1.0.1",
        "extract-text-webpack-plugin": "^1.0.1",
        "file-loader": "^0.11.1",
        "html-loader": "^0.5.5",
        "html-webpack-plugin": "^3.2.0",
        "style-loader": "^0.23.1",
        "url-loader": "^1.1.2",
        "webpack": "^1.15.0"
      },
      "dependencies": {}
    }
    回复 有任何疑惑可以回复我~ 2018-11-09 21:17:45
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信