首页 > 解决方案 > Axios + Vue + ag-grid-vue ... 未找到依赖项

问题描述

所以,我对 VueJS 还是很陌生。在我的任何其他应用程序上集成 axios 从来都不是真正的问题,但由于某些原因,这个应用程序不会出现。

它不喜欢仅 npm,或仅 CDN,或 CDN+npm install 的当前实现。

希望大家能帮帮我!不太确定问题是什么,谷歌搜索也没有太大帮助。

~期望的结果:在 vue 应用程序中通过 axios 发布

~当前状态错误:

 ERROR  Failed to compile with 1 error 
"This dependency was not found:

* https://unpkg.com/axios/dist/axios.min.js?vue&type=script&lang=js& in ./src/App.vue

To install it, you can run: npm install --save https://unpkg.com/axios/dist/axios.min.js?vue&type=script&lang=js&"

~ 在 zShell 中运行以上命令时发生了什么: zsh: parse error near `&'

~package.json 文件:

  "name": "ag-grid",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "start": "App.vue"
  },
  "dependencies": {
    "ag-grid-community": "^25.2.1",
    "ag-grid-vue": "^25.2.0",
    "axios": "^0.21.1",
    "core-js": "^3.6.5",
    "vue": "^2.6.11",
    "vue-axios": "^3.2.4",
    "vue-property-decorator": "^8.5.1"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "node-sass": "^4.12.0",
    "sass-loader": "^8.0.2",
    "vue-template-compiler": "^2.6.11"
  }
}

~相关脚本代码:

    import { AgGridVue } from "ag-grid-vue";
    import { axios } from "axios";
    import { VueAxios } from "vue-axios";

标签: javascriptvue.jsaxiosnpm-installag-grid-vue

解决方案


推荐阅读