karvai
karvai

Reputation: 1797

NPM not recognised in WebStorm and unable to go back to past commands

I am using a mac and currently have node and npm installed. This works fine if I use the normal terminal. But it is not recognised in my Webstorm (using Ultimate version) terminal. Getting following output:

$ node
/bin/ksh: node: not found
$ npm
/bin/ksh: npm: not found
$ 

Also if I try to click up to go back to past commands, it doesn't work either. I end up with following output:

^[[A

If I try with others such as Java, it works fine as follows:

$ java -version
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)

Noticed that Webstorm is definitely picking up my node path considering it is visible when I try to create a new project as shown in following image:

enter image description here

What am I doing wrong? I have seen setups in colleagues laptops and they do not have node/npm set up in bash_profile but everything still works. Could I get some help with this please. Thanks.

Upvotes: 1

Views: 2805

Answers (1)

kar
kar

Reputation: 3651

It's to do with the choice of your shell. looks like you have chosen to use ksh. Switch it back to something like bash.

I would suggest to do this gobally so that you don't have to keep doing this every time you open a new project.

  1. Thus close your project, click Configure on bottom left and choose Preferences.
  2. Select Tools -> Terminal
  3. Under Application Settings, change your Shell path to /bin/bash (it should be /bin/ksh currently).
  4. Apply and ok. Open your project and try to perform above actions which should work now.

Upvotes: 2

Related Questions