node_modules以下の.binをパスに加える

PowerShell

 $env:path = ".\node_modules\.bin;" + $env:path # 一時的に設定する
 notepad.exe $profile # 常にパスの設定を有効にするなら、上の内容をプロファイルに記述する

パスが通っているか確認する

 npm install foo # 適当なパッケージをインストールして、
 get-command foo # node_modules\.binにインストールされたコマンドのパスを確認する

環境変数 - Windows

  • WIN+Rキーを押下して、sysdm.cplと入力し、システムのプロパティを開く。
  • ユーザー環境変数PATHに.\node_modules\.binを追加する。
  • なお、ユーザー環境変数の操作はPowerShellでも可能だが、間違いやすいのでコントロールパネル経由の方が無難。

参考

https://stackoverflow.com/questions/573817/where-are-environment-variables-stored-in-registry

参考

https://superuser.com/questions/392271/prepend-to-path-variable-windows


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS

Last-modified: 2019-04-09 (火) 17:00:48