p238049y / typeScript-practice

typeScriptの処理を勉強するためのリポジトリ
0 stars 0 forks source link

【タスク】環境構築 #1

Closed p238049y closed 6 days ago

p238049y commented 3 weeks ago

ここら辺を参考にする

p238049y commented 3 weeks ago

npm更新

~/w/typeScript-practice ❯❯❯ npm install -g typescript

added 1 package in 903ms
npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1
npm notice To update run: npm install -g npm@10.8.1
npm notice
~/w/typeScript-practice ❯❯❯ npm install -g npm@10.8.1

removed 2 packages, and changed 63 packages in 2s

24 packages are looking for funding
  run `npm fund` for details
p238049y commented 3 weeks ago

// package.jsonの作成

❯❯❯ npm init -y

Wrote to /Users/nishimuraisamu/workspace/typeScript-practice/package.json:

{
  "name": "typescript-practice",
  "version": "1.0.0",
  "description": "typeScriptの処理を勉強するためのリポジトリ",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

//tsconfig.jsonの作成

❯❯❯ tsc --init
Created a new tsconfig.json with:                                                                                       
                                                                                                                     TS 
  target: es2016
  module: commonjs
  strict: true
  esModuleInterop: true
  skipLibCheck: true
  forceConsistentCasingInFileNames: true

You can learn more at https://aka.ms/tsconfig
p238049y commented 3 weeks ago

~/w/typeScript-practice ❯❯❯ node dist/app.js Hello, TypeScript

OK