vue-cliをWindows10にインストールする



```terminal
npm install -g vue-cli
```

```terminal
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
C:\Program Files (x86)\Nodist\bin\vue -> C:\Program Files (x86)\Nodist\bin\node_modules\vue-cli\bin\vue
C:\Program Files (x86)\Nodist\bin\vue-init -> C:\Program Files (x86)\Nodist\bin\node_modules\vue-cli\bin\vue-init
C:\Program Files (x86)\Nodist\bin\vue-list -> C:\Program Files (x86)\Nodist\bin\node_modules\vue-cli\bin\vue-list
+ vue-cli@2.9.
```

2.9.は古いバージョンのようなので削除する

```terminal
npm uninstall -g vue-cli
```


書き方を変えてもう一回新しいほうをインストールする

```terminal
npm install -g @vue/cli
```

```terminal
C:\Program Files (x86)\Nodist\bin\vue -> C:\Program Files (x86)\Nodist\bin\node_modules\@vue\cli\bin\vue.js

> protobufjs@6.8.8 postinstall C:\Program Files (x86)\Nodist\bin\node_modules\@vue\cli\node_modules\protobufjs
> node scripts/postinstall


> nodemon@1.18.3 postinstall C:\Program Files (x86)\Nodist\bin\node_modules\@vue\cli\node_modules\nodemon
> node bin/postinstall || exit 0

Love nodemon? You can now support the project via the open collective:
 > https://opencollective.com/nodemon/donate

npm WARN apollo-client@2.3.7 requires a peer of graphql@^0.11.0 || ^14.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\@vue\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @vue/cli@3.0.0-rc.10
added 622 packages in 32.329s
```

追加のアドオンを入れなければいけないらしいのでそれもいれる

```terminal
npm install -g @vue/cli-service-global
```

```terminal
npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!

> yorkie@1.0.3 install C:\Program Files (x86)\Nodist\bin\node_modules\@vue\cli-service-global\node_modules\yorkie
> node bin/install.js

setting up Git hooks
trying to install from sub 'node_module' directory, skipping Git hooks installation
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\@vue\cli-service-global\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @vue/cli-service-global@3.0.0-rc.10
added 1311 packages in 70.202s
```

バージョンを確認する

```
vue --version
```

```
3.0.0-rc.10
```

```vue:app.vue
<template>
  <h1>Hello!</h1>
</template>
```


```terminal
vue serve
```

```terminal
 INFO  Starting development server...                                                       94% after seal
 ERROR  Failed to compile with 1 errors                                                                                                                                                                                 17:25:03
This dependency was not found:
* ~entry in C:/Program Files (x86)/Nodist/bin/node_modules/@vue/cli-service-global/template/main.js
To install it, you can run: npm install --save ~entry
```



カラのmain.jsファイルをつくる

```js:main.js
```


```
C:\sites\mylesson\vuejs>vue serve
```

```terminal
 INFO  Starting development server...
 DONE  Compiled successfully in 4946ms
  App running at:
  - Local:   http://localhost:8080/
  - Network: http://10.143.103.31:8080/
  Note that the development build is not optimized.
  To create a production build, run npm run build.
```