Typescript: tsserver shows 'No such file or directory' error for npm path

Created on 6 May 2018  Β·  1Comment  Β·  Source: microsoft/TypeScript


TypeScript Version: 2.8.3


Search Terms: npm "No such file or directory"

Code

Run following command from terminal:

$ tsserver

Expected behavior:

tsserver starts without any errors or warnings.

Actual behavior:

Following error is shown in stderr:

/bin/sh: /usr/local/Cellar/node/9.4.0/bin/npm: No such file or directory

Playground Link: N/A

Related Issues: None

This is a problem related to detecting default npm path in tsserver. At least Node v9.4.0 does not install npm to the same directory as node command. It is installed in /usr/local/lib/node_modules/npm like other normal npm packages.

Bug help wanted

Most helpful comment

same issue on my end, it tries to find npm in [tsserver] /bin/sh: /opt/local/bin/npm: No such file or directory but it's in /usr/local/bin/npm

>All comments

same issue on my end, it tries to find npm in [tsserver] /bin/sh: /opt/local/bin/npm: No such file or directory but it's in /usr/local/bin/npm

Was this page helpful?
0 / 5 - 0 ratings