0
我刚开始使用vue js,我正在学习一个教程。要开始我在命令行中输入以下内容:使用vue启动创建的应用程序抛出错误
vue init webpack test-app
我插入项目标题,作者,我不安装lint和测试框架。 我进入项目文件夹,然后运行NPM安装和NPM运行dev的,但我得到这个错误:
ERROR Failed to compile with 2 errors 4:58:04 PM
error in ./src/App.vue
Syntax Error: Unexpected token {
@ ./~/vue-style-loader!./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"id":"data-v-17d125bb","scoped":false,"hasInlineConfig":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue 4:14-303 13:3-17:5 14:22-311
@ ./src/App.vue
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js
error in ./src/components/Hello.vue
Syntax Error: Unexpected token {
@ ./~/vue-style-loader!./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"id":"data-v-369af42f","scoped":true,"hasInlineConfig":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/components/Hello.vue 4:14-313 13:3-17:5 14:22-321
@ ./src/components/Hello.vue
@ ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/App.vue
@ ./src/App.vue
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js
> Listening at http://localhost:8080
我若去为localhost:8080,我只能看到:
Cannot GET/
有什么可以代码中的错误与新的intallation?
编辑:这是App.vue文件
<template>
<div id="app">
<img src="./assets/logo.png">
<hello></hello>
</div>
</template>
<script>
import Hello from './components/Hello'
export default {
name: 'app',
components: {
Hello
}
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
我猜想有一个'Unexpected token {''in。/ src/App.vue' – thanksd
这是我第一次使用vue,并且在app.vue中一切看起来都很好。我没有碰任何文件,这是一个全新的安装,这就是为什么我觉得奇怪... – ste
嗯我重复你的步骤,它为我工作。 – thanksd