Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js Vue Cli应用程序无法部署到heroku“;错误:Can';t解决vue axios”问题;_Vue.js_Heroku - Fatal编程技术网

Vue.js Vue Cli应用程序无法部署到heroku“;错误:Can';t解决vue axios”问题;

Vue.js Vue Cli应用程序无法部署到heroku“;错误:Can';t解决vue axios”问题;,vue.js,heroku,Vue.js,Heroku,嘿,我正在尝试将Vue Cli应用程序部署到heroku。在部署时,我收到一个错误,告诉我错误:无法解析vue axios 以下是部署日志: -----> Node.js app detected -----> Creating runtime environment NPM_CONFIG_LOGLEVEL=error NODE_ENV=production NODE_MODULES_CACHE=true NODE_

嘿,我正在尝试将Vue Cli应用程序部署到heroku。在部署时,我收到一个错误,告诉我错误:无法解析vue axios

以下是部署日志:

    -----> Node.js app detected

-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false

-----> Installing binaries
       engines.node (package.json):  10.16.3
       engines.npm (package.json):   6.11.3
       engines.yarn (package.json):  1.17.3

       Resolving node version 10.16.3...
       Downloading and installing node 10.16.3...
       Bootstrapping npm 6.11.3 (replacing 6.9.0)...
       npm 6.11.3 installed
       Resolving yarn version 1.17.3...
       Downloading and installing yarn (1.17.3)...
       Installed yarn 1.17.3

-----> Installing dependencies
       Installing node modules (yarn.lock)
       yarn install v1.17.3
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       info fsevents@1.2.9: The platform "linux" is incompatible with this module.
       info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
       [3/4] Linking dependencies...
       [4/4] Building fresh packages...
       Done in 35.63s.

-----> Build
       Running build (yarn)
       yarn run v1.17.3
       $ node build/build.js
       Hash: 1a4e581f1f6c87da11b4
       Version: webpack 3.12.0
       Time: 21964ms
                                                         Asset       Size  Chunks                    Chunk Names
                      static/js/vendor.10e0802120f8774812f8.js     156 kB       0  [emitted]         vendor
                         static/js/app.b921d7af8c4576a6f4bb.js    3.33 kB       1  [emitted]         app
                    static/js/manifest.2ae2e69a05c33dfc65f8.js  857 bytes       2  [emitted]         manifest
           static/css/app.07528487cac3300d975fbf17c681c8bf.css     652 kB       1  [emitted]  [big]  app
       static/css/app.07528487cac3300d975fbf17c681c8bf.css.map    1.14 MB          [emitted]         
                  static/js/vendor.10e0802120f8774812f8.js.map     771 kB       0  [emitted]         vendor
                     static/js/app.b921d7af8c4576a6f4bb.js.map    21.5 kB       1  [emitted]         app
                static/js/manifest.2ae2e69a05c33dfc65f8.js.map    4.97 kB       2  [emitted]         manifest
                                                    index.html  509 bytes          [emitted]         

       ERROR in ./src/main.js
       Module not found: Error: Can't resolve 'Vue-axios' in '/tmp/build_f242124990dad1f5430be392e7ea3925/src'
        @ ./src/main.js 6:0-33

         Build failed with errors.

error Command failed with exit code 1.
       info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
-----> Build failed

       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys

       If you're stuck, please submit a ticket so we can help:
       https://help.heroku.com/

       Love,
       Heroku

 !     Push rejected, failed to compile Node.js app.
 !     Push failed
我已经查看了package.json,所有的依赖项都在那里,所以我很困惑如何继续部署这个错误

在这件事上,任何帮助都将不胜感激

更新my main.js文件如下所示:

// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import VueAxios from 'Vue-axios'
import { securedAxiosInstance, plainAxiosInstance } from './backend/axios'
import './main.css'

Vue.config.productionTip = false
Vue.use(VueAxios, {
  secured: securedAxiosInstance,
  plain: plainAxiosInstance
})
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  securedAxiosInstance,
  plainAxiosInstance,
  components: { App },
  template: '<App/>'
})
//要使用“import”命令加载的Vue生成版本
//(仅限运行时或单机版)已在webpack.base.conf中使用别名设置。
从“Vue”导入Vue
从“./App”导入应用程序
从“./路由器”导入路由器
从“Vue axios”导入VueAxios
从“./backend/axios”导入{securedAxiosInstance,plainaxioInstance}
导入“./main.css”
Vue.config.productionTip=false
Vue.use(VueAxios{
安全的:安全的,
普通的:普通的
})
/*eslint禁用无新*/
新Vue({
el:“#应用程序”,
路由器,
安全的立场,
朴素的立场,
组件:{App},
模板:“”
})

该软件包名为vue axios,全部为小写。您的导入中有Vue axios,只是输入错误。

Vue axios是否列在您的依赖项上?@mulsun“dependencies”:{“axios”:“^0.19.0”、“tailwindcss”:“^1.1.2”、“Vue”:“^2.5.2”、“Vue axios”:“^2.1.4”、“Vue路由器”:“^3.0.1”},请尝试
从“Vue axios”导入Vue axios”
可能存在案例问题(linux)。