Vue.js 获取错误“未能编译未找到的模块:错误:无法解析“babel loader”
我正在使用vue将谷歌地图导入我的应用程序 但它不允许我在导入应用程序后运行它Vue.js 获取错误“未能编译未找到的模块:错误:无法解析“babel loader”,vue.js,babeljs,vue2-google-maps,Vue.js,Babeljs,Vue2 Google Maps,我正在使用vue将谷歌地图导入我的应用程序 但它不允许我在导入应用程序后运行它 import Vue from 'vue' import App from './App.vue' import * as VueGoogleMaps from "vue2-google-maps"; Vue.use(VueGoogleMaps, { load: { key: "", libraries: "places" // necessary for places input } })
import Vue from 'vue'
import App from './App.vue'
import * as VueGoogleMaps from "vue2-google-maps";
Vue.use(VueGoogleMaps, {
load: {
key: "",
libraries: "places" // necessary for places input
}
});
new Vue({
el: '#app',
render: h => h(App)
})
这就是我得到的错误
Failed to compile.
/Users/temporary/node_modules/vue2-google-maps/dist/components/infoWindow.vue
Module not found: Error: Can't resolve 'babel-loader' in '/Users/temporary/node_modules/vue2-google-maps/dist/components'
@ /Users/temporary/node_modules/vue2-google-maps/dist/components/infoWindow.vue 4:0-161 5:0-174
@ /Users/temporary/node_modules/vue2-google-maps/dist/main.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js
您是否在此项目中使用vue cli?如果是这样,您应该能够做到:
npm安装-保存开发babel加载程序
或者如果你用的是纱线
纱线添加-开发巴别塔加载器
如果您不使用vue cli,则仍然需要使用上述方法安装babel loader,但还必须将其添加到您的网页包配置中
更多关于babel loader的信息: