Closed lebsral closed 7 years ago
Dupe of https://github.com/angular/angular-cli/issues/1560#issuecomment-240913794. Other problems seem related to the upgrade of webpack betas, which is now has better instructions in https://github.com/angular/angular-cli#webpack-update.
@JohnMcGuinness solution fixed the issue for me.
I struggled with this quite a bit as well. What seemed to work for me was to delete node_modules, and run ng init. I actually followed the following:
It worked for me with a similar solution to @M4ttsson.
Changed the typescript value in my package.json to "2.0.0" Completely removed node_modules folder ran ng init, skipped everything ng serve
I take it back... back to ground zero...
Has anyone managed to install angular-cli as a local dependency? That is without the "-g". Maybe there should be a separate issue for that?
Thought I'd put this out there... I was getting the same warnings as everyone described. In my code, I am getting 2 messages:
I felt this meant that Promises would not work. I also don't understand why I get the "Experimental Decorator" message.
However, Promises DO work, even though it claims that the name is not found.
Any ideas?
Thanks
@rfarina, I think that is just a bug in Visual Studio Code, totally unrelated. I keep getting the same problems without angular-cli, I just restart Visual Studio and the problem disappears :-)
I had this problem too. Vs code used an older version of typescript than my project. So it showed these errors but when compiled with the project version everything was fine. I changed vs code typescript version and the problem went away, add the setting typescript.tsdk and point it to the path of node_modules typescript location.
@lcrespom, that's funny. I ONLY get it in the angular-cli versions :) As an update, I found that by commenting out the @Injectable() method, the squiggly lines go away and the code still runs. It's almost as if it's just not needed.
@lcrespom @M4ttsson With both your help and the suggestion of @M4ttsson, I modified the vs code workspace settings for the typescript location. By default it is set to "null". I set it to the following, reloaded vs code, and all seems to be working as expected with both Decorators and Promise, etc.
"typescript.tsdk": "./node_modules/typescript/lib"
+-- UNMET PEER DEPENDENCY @angular/common@^2.0.0 +-- UNMET PEER DEPENDENCY @angular/core@^2.0.0 +-- UNMET PEER DEPENDENCY @angular/http@^2.2.0 `-- @angular2-material/core@2.0.0-alpha.8-2
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN @angular/material@2.0.0-beta.1 requires a peer of @angular/core@^2.2.0 but none was installed. npm WARN @angular/material@2.0.0-beta.1 requires a peer of @angular/common@^2.2.0 but none was installed. npm WARN @angular/material@2.0.0-beta.1 requires a peer of @angular/http@^2.2.0 but none was installed. npm WARN @angular2-material/core@2.0.0-alpha.8-2 requires a peer of @angular/core@^2.0.0 but none was installed. npm WARN @angular2-material/core@2.0.0-alpha.8-2 requires a peer of @angular/common@^2.0.0 but none was installed. npm WARN angular2-demo@1.0.0 No description npm WARN angular2-demo@1.0.0 No repository field.
Installing angular material design but this issue
I am facing this kind of issue
Issue : @angular/compiler-cli@5.0.2 requires a peer of @angular/compiler@5.0.2 but none was installed
Solution to Above issue is
Yeah, develop your in-house solution instead.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.