Skip to content

tsserver shows 'No such file or directory' error for npm path #23924

@rhysd

Description

@rhysd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions