欢迎各位兄弟 发布技术文章
这里的技术是共享的
$ npm i --save @angular/cdk
Bug, feature request, or proposal:
What is the expected behavior?Application will run What is the current behavior?Angular Material throw error What are the steps to reproduce?Install all dependencies and run aplication which use angular material Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Log ERROR in node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(8,32): error TS2307: Cannot find module '@angular/cdk/bidi'. webpack: Failed to compile. |
Did you install |
Yes latest version (5.0.0-rc0) |
The errors you are seeing would point to I would suggest to try removing your |
@josephperrott I tried it too, but I can try it again.. |
Unfortunately we are not able to reproduce this in stackblitz (or locally for what its worth). Can you provide your |
@josephperrott Which? In the project or somewhere else? |
@Flayovec your project's |
@willshowell I don't have enough time today, I will post it here tomorrow. But I don't have changed anything in the package.json, it is same as angular cli generated it. Maybe this is the problem... I'm new in using Angular and NPM, I don't want to damage something so I don't haven't change anything in that files. |
@Flayovec it should be as easy as copy-pasting It should contain a
Further, if you are using git and committing when the project is in a working state, you can edit files with confidence that you'll be able to later revert your changes. The following commands would likely fix this: npm install --save @angular/material @angular/cdk rm -rf node_modules npm install |
Thank you, I will try it tomorrow. But I think this will solve all problems. |
i am also having same problem @willshowell |
@mantupani17 my npm install of hammerjs had messed things up. hammerjs needed my terminal launched as administrator. After that succeeded I still had to delete the node_modules directory and do npm install again to re-add everything. After that ng build succeeds again |
I hope I can help with this, delete the folder "layout" inside of node_modules/@ angular/ . Replace with the link file. https://drive.google.com/file/d/1o26ilKwJNTKtREikOtiJmLEel4s90mZv/view |
@biostec the link is not exist please can you give me this file , Thank you |
@YousefMegahed just copy and paste the link in a new windows, the link is not broken |
npm install --save-dev @angular/forms@latest #"Worked for me" |
Make absolutely sure the What happened to me was
The |
it fixed install
|
Juste have the same issue from a totally new project. Install nodeJs (10.9.0) Add material (npm install --save @angular/material @angular/cdk @angular/animations)
I don't know if it's exactly the same as described here, but the fix is the same. @josephperrott |
Just try
this works for me |
Adding @angular/cdk, removing node_modules and doing npm install after that, worked for me - thanks guys! |
run npm install then ng serve |
The following fixed my issue: |
@Monu-Chaudhary it works for me! |
Why i cant able run ng generate @angular/material:nav navbar2 i am getting an error i have installed every package |
@RANJITHAGANGADHAR - run "npm cache clean --force" then run your command after |
Just run: |
来自 https://github.com/angular/components/issues/8306
Bug, feature request, or proposal:Bug What is the expected behavior?Being able to start an app with Angular Material What is the current behavior?After an What are the steps to reproduce?I cannot show you the source code as it's proprietary. The full process has been:
https://gist.github.com/theCrius/bbee299f3e5aeec9e911279b7fb684b3 Both the package.json are also present in this gist. The original project was writte in June 2016 so I suppose the issue is related to changes in @angular/material2 as the issue comes from not finding @angular/cdk missing package. What is the use-case or motivation for changing an existing behavior?Not applicable. Which versions of Angular, Material, OS, TypeScript, browsers are affected?I can't make to the browser. The error is being showed in the console. Is there anything else we should know?Don't know if it can be useful, the current ng --version result is as follows:
|
Did you install CDK as well?
|
Feeling quite stupid right now. Too much time spent trying to figure it out I suppose. After installing the CDK explicitly the error is reduced to:
I also sees that the html files are still using the |
@theCrius Did you include a theme as well (see step 4)?
|
Yes, after installing the CDK I went forward and installed a default theme. The following errors were about the MaterialModule so I went ahead and:
I'm now dealing with more nasty changes like the datepickers not being Luckily the guy that thought that using beta stuff to release productions level application had left. So after I lose all my hairs fixing his projects, this won't happens this often. Thanks for the support donroyco :) |
Yes, but to do that I would have to first install angular 2.beta.11 which for some reason fails on the package json that I found in the project. I didn't had time to investigate that when I could simply run a regexp search&replace and load up the component in the module.ts. It's more of a hassle switch to beta.11 and then to 5.x today then just do what I did. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
来自 https://github.com/angular/components/issues/10997