question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:12
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
fuzunspmcommented, Jun 18, 2020

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

4reactions
rhysdcommented, Jan 30, 2021

It should work. But making users create a symlink in system directories is not a fix for this issue, I think.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What could cause an error related to npm not being able to ...
Open command prompt , go to path angular folder and run Yarn. Run angular\nswag\refresh.bat. Run npm start from the angular folder.
Read more >
Npm no such file or directory
ENV NODE_ENV=production WORKDIR /app COPY ["package. . x. C:\Users\PC>npm install npm ERR! path C:\Users\PC\. Then run, C:\Users\Nuwanst\Documents\NodeJS.
Read more >
Common errors | npm Docs
You are trying to install on a drive that either has no space, or has no permission to write. Free some disk space...
Read more >
lsp-mode can't find npm : r/emacs - Reddit
... it outputs this error: [tsserver] /bin/sh: /opt/local/bin/npm: No such file or directory ... Above path is in my .env and emacs config....
Read more >
jsconfig.json Reference - Visual Studio Code
The presence of such a file in a directory indicates that the directory is the root of a JavaScript project. The file itself...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found