★★(大分類D) 新しいMac Book Pro

大分類 D

D1) TypeScript

D2) Gulp

D3) Yarn

D4) npmとyarnのコマンド早見表

D5) nodenv状況確認

npm install -g typescript

tscにPATHを通す。

eco export PATH=$PATH: `npm bin -g`
$ tsc -v

Version 4.3.5


$npm ls -g typescript

/Users/[user]/.anyenv/envs/nodenv/versions/16.4.2/lib
└── typescript@4.3.5

D2) Gulp

$ npm install --global gulp

.bash_profile に追記しておく

$ echo 'export PATH=$PATH:./node_modules/.bin' >> ~/.bash_profile
$  gulp -v
CLI version: 2.3.0
Local version: Unknown

D3)

  • [失敗した方法]
    • Homebrew経由
  • [成功した方法]
    • npm経由で、npm install -g yarn

https://chaika.hatenablog.com/entry/2021/03/26/083000

yarn のインストール
global へのインストールで少しハマったのでメモ

$ npm install -g yarn


# nodenv rehash で global にある npm へのパスを通す必要があった
$ nodenv rehash

$ yarn --version
1.22.11

D4)

https://qiita.com/rubytomato@github/items/1696530bb9fd59aa28d8

D5) nodenvで状況確認

https://qiita.com/kolife/items/61cd75da5906a147fe7f

$ curl -fsSL https://github.com/nodenv/nodenv-installer/raw/master/bin/nodenv-doctor | bash

Checking for `nodenv' in PATH: multiple
  You seem to have multiple nodenv installs in the following locations.
  Please pick just one installation and remove the others.
  
  /Users/[user]/.anyenv/envs/nodenv/bin/nodenv
  /usr/local/bin/nodenv



Checking for nodenv shims in PATH: OK
Checking `nodenv install' support: multiple
  You seem to have multiple `nodenv-install' in the following locations.
  Please pick just one installation and remove the others.
  
  # nodenv経由
  /Users/[user]/.anyenv/envs/nodenv/plugins/node-build/bin/nodenv-install
  # Homebrew経由
  /usr/local/bin/nodenv-install


Counting installed Node versions: 2 versions
Auditing installed plugins: OK

余計な方を削除

$ rm -rf /usr/local/bin/nodenv
$ rm -rf /usr/local/bin/nodenv-install

以下の表示が出たらOK

$ curl -fsSL https://github.com/nodenv/nodenv-installer/raw/master/bin/nodenv-doctor | bash

Checking for `nodenv' in PATH: /Users/[user]/.anyenv/envs/nodenv/bin/nodenv

Checking for nodenv shims in PATH: OK

Checking `nodenv install' support: /Users/[user]/.anyenv/envs/nodenv/plugins/node-build/bin/nodenv-install (node-build 4.9.46)

Counting installed Node versions: 2 versions

Auditing installed plugins: OK

qiita.com



目次へ戻る

noel-ingenieur.hateblo.jp