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.

tsc: not found on npm start

See original GitHub issue

Although I have installed the dependencies with npm install and can see the package typescript when I do npm list typescript, I still get this error. Only when I npm install -g typescript concurrently I can manage to get npm start working. The angular2-quickstart guide does not state this so I suppose I should not have any problems without installing with the -g option. If -g is a must, then the guide should state this I guess.

vagrant@local:~/angular2-quickstart$ npm start

> angular2-quickstart@1.0.0 start /home/vagrant/angular2-quickstart
> tsc && concurrently "tsc -w" "lite-server" 

sh: 1: tsc: not found

npm ERR! Linux 3.13.0-77-generic
npm ERR! argv "/home/vagrant/.nvm/versions/node/v6.5.0/bin/node" "/home/vagrant/.nvm/versions/node/v6.5.0/bin/npm" "start"
npm ERR! node v6.5.0
npm ERR! npm  v3.10.3
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! angular2-quickstart@1.0.0 start: `tsc && concurrently "tsc -w" "lite-server" `
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the angular2-quickstart@1.0.0 start script 'tsc && concurrently "tsc -w" "lite-server" '.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

18reactions
rasorcommented, Nov 11, 2017

I had to copy typescript from devDependencies to

  "dependencies": {
    "typescript": "^2.4.0"
7reactions
vyskercommented, Oct 24, 2016

@olivierto I had the same issue. Try adding this to your Dockerfile

RUN npm install -g tsc \
    && npm install -g concurrently \
    && npm install -g typescript \

For me, that only solved part of the issue. For some reason, npm install did not save the dependencies after installing them. So I had to manually run npm install in the docker container, i.e. docker run angular npm install and then docker run angular npm run typings install.

This is only a workaround, of course. But at least it gets things going. I have yet to find a solution.

Hope that helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

'tsc command not found' in compiling typescript - Stack Overflow
If your TSC command is not found in MacOS after proper installation of TypeScript (using the following command: $ sudo npm install -g ......
Read more >
TypeScript tsc command not found | Edureka Community
Your answer · restart the terminal · restart the machine · reinstall nodejs + then run npm install typescript -g.
Read more >
tsc-start - npm
Wrapper around tsc --watch , when it sees Found 0 errors in the stdout it starts the target. It also preloads dependencies to...
Read more >
How to set up TypeScript
You can use npm to install TypeScript globally, this means that you can use the tsc command anywhere in your terminal. To do...
Read more >
Typescript support? - Render community
Ah yes, you'll have to run npm or yarn beforehand to get the dependencies. If you're using tsc (or any other npm/yarn-installed command)...
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