vux项目报错

发布于 2022-09-05 01:47:30 字数 2793 浏览 9 评论 0

 ERROR  Failed to compile with 1 errors                                                                                                                              17:08:52

This dependency was not found:

* -!../../node_modules/css-loader/index.js?{"minimize":false,"sourceMap":false}!vux/dist/vux.css in ./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"id":"data-v-0bcc393d","scoped":false,"hasInlineConfig":true}!./~/vux-loader/src/style-loader.js!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/components/home.vue

To install it, you can run: npm install --save -!../../node_modules/css-loader/index.js?{"minimize":false,"sourceMap":false}!vux/dist/vux.css

vux项目编译的时候报这个错
这是怎么回事 该如何解决呢

{
  "dependencies": {
    "css-loader": "^0.26.4",
    "fastclick": "^1.0.6",
    "vue": "^2.2.2",
    "vue-router": "^2.2.0",
    "vuex": "^2.1.1",
    "vuex-i18n": "^1.3.1",
    "vux": "^2.2.1"
  },
  "devDependencies": {
    "autoprefixer": "^6.7.2",
    "babel-core": "^6.22.1",
    "babel-eslint": "^7.1.1",
    "babel-loader": "^6.2.10",
    "babel-plugin-transform-runtime": "^6.22.0",
    "babel-preset-env": "^1.2.1",
    "babel-preset-stage-2": "^6.22.0",
    "babel-register": "^6.22.0",
    "chalk": "^1.1.3",
    "compression-webpack-plugin": "^0.3.2",
    "connect-history-api-fallback": "^1.3.0",
    "copy-webpack-plugin": "^4.0.1",
    "css-loader": "^0.26.1",
    "eslint": "^3.14.1",
    "eslint-config-standard": "^6.2.1",
    "eslint-friendly-formatter": "^2.0.7",
    "eslint-loader": "^1.6.1",
    "eslint-plugin-html": "^2.0.0",
    "eslint-plugin-promise": "^3.4.0",
    "eslint-plugin-standard": "^2.0.1",
    "eventsource-polyfill": "^0.9.6",
    "express": "^4.14.1",
    "extract-text-webpack-plugin": "^2.0.0",
    "file-loader": "^0.10.0",
    "friendly-errors-webpack-plugin": "^1.1.3",
    "function-bind": "^1.1.0",
    "html-webpack-plugin": "^2.28.0",
    "http-proxy-middleware": "^0.17.3",
    "less": "^2.7.1",
    "less-loader": "^2.2.3",
    "opn": "^4.0.2",
    "optimize-css-assets-webpack-plugin": "^1.3.0",
    "ora": "^1.1.0",
    "rimraf": "^2.6.0",
    "semver": "^5.3.0",
    "stylus": "^0.54.5",
    "url-loader": "^0.5.7",
    "vue-loader": "^11.1.4",
    "vue-style-loader": "^2.0.0",
    "vue-template-compiler": "^2.2.4",
    "vux-loader": "^1.0.58",
    "webpack": "^2.2.1",
    "webpack-bundle-analyzer": "^2.2.1",
    "webpack-dev-middleware": "^1.10.0",
    "webpack-hot-middleware": "^2.16.1",
    "webpack-merge": "^2.6.1",
    "yaml-loader": "^0.4.0"
  },
  "engines": {
    "node": ">= 4.0.0",
    "npm": ">= 3.0.0"
  },
  "browserslist": [
    "iOS >= 7",
    "Android >= 4.1"
  ]
}

补上package.json
依然报错

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

哆啦不做梦 2022-09-12 01:47:31

我是使用vue-cli 使用的框架引入配置也出现这个错误,临时
解决办法:到vux/dist/ 建立一个空的同名文件vux.css即可解决报错问题(成功显示组件)
遗留:编译出来的组件不知道会不会把样式编译进去
引起原因:css-loader 虽然安装成功,但没有成功编译? 不排除其他原因...
我是个新手,不太懂使用这种组件开发的问题,比较复杂,希望我的回答帮到你,如果你已经解决了这个问题,可以给我留言是怎么解决的?原因出在哪里?谢谢!!!
ps:官方文档就是一坨屎!!!一坨屎!!!一坨屎!!!

更新:刚刚发现,问题原因应该是你的模板引用了不存在的文件@import '~vux/dist/vux.css';? 所以建一个空文件就不报错了,或者把你引用的文件那句去掉吧!

野稚 2022-09-12 01:47:30

根本原因是,引用的样式文件的路径不对!没有文件造成的!

混浊又暗下来 2022-09-12 01:47:30

css-loader 没有安装.

咆哮 2022-09-12 01:47:30

npm install css-loader --save
把英语好好学学。。。。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文