Skip to content

Module cannot be found after installing package 'ts-odatajs' in clean project #11830

@Diemauerdk

Description

@Diemauerdk

Just 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

  1. ng new angularTest
  2. cd angularTest
  3. npm i ts-odatajs
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions