-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Question: How did you avoid typescript errors not finding node modules? #96
Comments
Sounds like tsconfig.json issue. Did you override |
Nope, I didn't touch the tsconfig, just using Angular's defaults. I set up a project here. There are just 2 commits. The first one is the output of |
Hi there, nice project! I'm trying to figure out how some things work in your project for better understanding 😄 I hope it's okay to post a question here 👼 .
When importing a node-module in your AppComponent, for example using the following line, it just works:
import * as fs from 'fs';
However, if I try to set up an Angular project manually that I can later open in electron, I am not able to compile, because I get the following error:
error TS2307: Cannot find module 'fs'.
What I did:
I created a simple new Angular 7 app + added a custom webpack config (listing 'fs' as external as in your webpack config) + updated angular.json to use that config (using @angular-builders/custom-webpack:browser and customWebpackConfig-option, exactly as you did). Then run
ng build
.NOTE: @types/node and @angular-devkit/build-angular are installed and my editor (VSCode) is not showing any error.
Am I missing something? How do I get the ts-code compiled?
Best regards
The text was updated successfully, but these errors were encountered: