LoginSignup
0
0

More than 3 years have passed since last update.

npmでローカルにインストールしたコマンドを実行する

Last updated at Posted at 2020-08-13

エラー内容

チュートリアルのサンプルコードを実行しようとして、コマンドが存在しないエラーになりました。


% jest my-test --notify --config=config.json
zsh: command not found: jest

解決方法

コマンドは./node_modules/.binに集められています。下記のようにパスを指定して実行してください。


% ./node_modules/.bin/jest --notify --config=config.json

追記

npm5.2.0からはnpxコマンドで同じことができますので、npxをご利用ください。

% npx jest --notify --config=config.json

npmのバージョン表示は

% npm -v
6.14.8

参照

npxの詳しい説明
https://qiita.com/tonkotsuboy_com/items/8227f5993769c3df533d

npxの公式リファレンス
https://www.npmjs.com/package/npx

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