-
Notifications
You must be signed in to change notification settings - Fork 12k
Getting "Cannot find module" when trying to use custom schematics with new
command
#7744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Barring documentation, it would be great if we could get some official feedback on whether or not we're even intended to be using this stuff yet. I get the sense that it's not production-ready for anything outside of the internal usage of it. But since there's no official word on this one way or another, a lot of us are very confused. |
So after updating to 1.4.3 the error is gone! ..and is replaced by a different one |
I can make it work this way: |
@feloy, thanks for putting this together! Looking forward to reading through this later tonight. |
@feloy, in the article you mention:
For users not able to publish their custom schematics and install via npm/yarn that way, |
I just can't figure out how to make it as globally installable package, I can get it to work inside cli's node_modules, but as soon as I move it to global deps, it starts throwing |
I think I figured out at least one part. I thought that cli would be able to work with typescript schematics, but it actually has to be compiled first. So instead of just cloning https://github.com/angular/devkit/tree/master/packages/schematics/angular you actually need to clone and work with its |
Yep. Still getting |
I'm also following this issue which is somewhat related. Would provide the ability to selectively extend the default collections. |
I hope there's going to be a way to set your collection as the default one so you don't have to |
So when I try to do
it generates it using
it says
which I think clearly indicates that it indeed is using my collection.. words can't even describe how frustrated I am |
Closing this. All of my problems are actual known bugs. Read more at https://stackoverflow.com/a/46431467/301596 (good piece of information about the state of schematics) |
I ran into some of these issues last night as well. You do need to compile and include both the
|
Good to know that simple tsc is enough. I thought I needed the whole angular-devkit. |
Nope, I just have the things under Here's the
|
And here's the
|
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. |
Uh oh!
There was an error while loading. Please reload this page.
There's little to no info about how to actually use schematics, so I tried forking
@schematics/angular
, changed couple things, published on npm (https://www.npmjs.com/package/@thescrollbar/schematics / https://github.com/thescrollbar/schematics), did following https://github.com/nrwl/nx/tree/master/packages/schematics#installing-nrwlschematics and triedng new impr --collection=@thescrollbar/schematics
, which throws error listed below.. in case you are wondering, that path does exist on my filesystem and does link to this https://github.com/thescrollbar/schematics/tree/master/applicationI also tried publishing contents of https://github.com/angular/devkit/tree/master/packages/schematics/angular to npm without changing anything and use it as schematics, didn't work either
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/cli: 1.4.2
node: 8.1.4
os: darwin x64
The log given by the failure.
The text was updated successfully, but these errors were encountered: