0
0

More than 3 years have passed since last update.

Node.jsインストール方法

Last updated at Posted at 2021-07-22

Node.jsというwebページ作成に便利なものがあることを知ったので、インストールから使い方まで説明していこうと思います。

動作環境

  • OS : macOS Big Sur 11.4
  • Node.js : 14.17.3 LTS

Node.jsのインストール

  • 以下のURLから推奨版をインストールしてください。個人的には最新版は不具合の影響でうまくいかなかったりするため推奨版を使用 https://nodejs.org/ja/

Node.jsのプロジェクトを作成

  • 以下のコマンドを実行し、プロジェクトを作成
  $ npx create-nuxt-app [プロジェクト名]
  • 途中で以下のような質問が聞かれるので、Package managerはNpmに設定し、それ以外はデフォルトの設定にしました
? Project name: sample_project
? Programming language: JavaScript
? Package manager: Npm
? UI framework: None
? Nuxt.js modules: (Press <space> to select, <a> to toggle all, <i> to invert se
lection)
? Linting tools: (Press <space> to select, <a> to toggle all, <i> to invert sele
ction)
? Testing framework: None
? Rendering mode: Universal (SSR / SSG)
? Deployment target: Server (Node.js hosting)
? Development tools: (Press <space> to select, <a> to toggle all, <i> to invert 
selection)
? What is your GitHub username? wataru-sakuraba
? Version control system: Git

  • ディレクトリ構成
    • 以下のようなディレクトリが作成される
.
├── README.md
├── components
│   ├── NuxtLogo.vue
│   └── Tutorial.vue
├── node_modules
│   └──多いため省略 
├── nuxt.config.js
├── package-lock.json
├── package.json
├── pages
│   └── index.vue
├── static
│   └── favicon.ico
└── store
    └── README.md
  • 必要なモジュールをインストール
$ npm install
  • プロジェクトを実行
$ npm run dev
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0