I generated Angular 4 app 3 weeks ago using the @angular/cli. After 2 weeks, I tried to run it with the command line \"ng serve\"
but I am prompted an error bel
I was able to solve this problem by removing node_modules then running "npm install"
If you don't have particular needs, I suggest to install Typescript locally.
npm install --global typescript # Global installation
npm install --save-dev typescript # Local installation
yarn global add typescript # Global installation
yarn add --dev typescript # Local installation
This should do the trick,
npm install -g typescript
I had a similar problem when I rearranged the folder structure of a project. I tried all the hints given in this thread but none of them worked. After checking further I discovered that I forgot to copy an important hidden file over to the new directory. That was
.angular-cli.json
from the root directory of the @angular/cli project. After I copied that file over all was running as expected.
Run: npm link typescript
if you installed globally
But if you have not installed typescript try this command: npm install typescript
I had the same problem. If you have installed first nodejs by apt and then you use the tar.gz from nodejs.org, you have to delete the folder located in /usr/lib/node_modules
.