Module cannot be found after installing package 'ts-odatajs' in clean project
See original GitHub issueJust a little comment to my report:
I have just upgraded my angular 5.2 application to angular 6. In the angular 5 application i did not see this error. So after i have been struggling with this issue for some time and since i could easily reproduce it in a clean new angular 6 solution, then I decided to submit this report 😃
- [ X] bug report
- [ ] feature request
- [ ] new
- [X ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Versions
Windows 10 Pro Node version: 8.9.3 NPM version: 5.5.1 Angular CLI version Angular CLI: 6.1.2 Node: 8.9.3 OS: win32 x64 Angular: @angular-devkit/architect 0.7.2 @angular-devkit/core 0.7.2 @angular-devkit/schematics 0.7.2 @schematics/angular 0.7.2 @schematics/update 0.7.2 rxjs 6.2.2 typescript 2.7.2
Repro steps
- ng new angularTest
- cd angularTest
- npm i ts-odatajs
- go to for example app.component.ts and make it contain the following:
import { Component } from '@angular/core';
import {oData} from 'ts-odatajs';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'angularTest';
oData;
constructor(){
oData.json
}
}
The log given by the failure
ERROR in ./node_modules/ts-odatajs/lib/odata/net.js Module not found: Error: Can’t resolve ‘http’ in ‘C:\Users\USER\Desktop\testDir\angularTest\node_modules\ts-odatajs\lib\odata’ ERROR in ./node_modules/ts-odatajs/lib/odata/net.js Module not found: Error: Can’t resolve ‘https’ in ‘C:\Users\USER\Desktop\testDir\angularTest\node_modules\ts-odatajs\lib\odata’
Desired functionality
Result: A successfull build
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (1 by maintainers)
Similar or duplicate issue here maybe? https://github.com/angular/angular-cli/issues/10694 We struggle with the same thing.
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.