angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Cannot resolve directory '@angular/http' Beta 1

Open billfranklin opened this issue 10 years ago • 7 comments

  1. OS. Windows 7 Enterprise
  2. Versions angular-cli: 1.0.0-beta.1 node: 5.10.1 os: win32 x64
  3. Repro steps. generated a new app and then a service, added "import { Http,Response } from '@angular/http';", WebStorm shows that it cannot resolve the directory.
  4. From system-config.ts
const barrels: string[] = [
  // Angular specific barrels.
  '@angular/core',
  '@angular/common',
  '@angular/compiler',
  '@angular/http',
  '@angular/router',
  '@angular/platform-browser',
  '@angular/platform-browser-dynamic',


billfranklin avatar May 10 '16 16:05 billfranklin

added "@angular/http": "2.0.0-rc.1" to package.json and ran npm install. Now it works. Need to update package.json

billfranklin avatar May 10 '16 17:05 billfranklin

I've been trying to get a PR done for just this thing. https://github.com/angular/angular-cli/pull/679

metric152 avatar May 10 '16 17:05 metric152

Possibly related? #612

aciccarello avatar May 10 '16 18:05 aciccarello

Also #685

aciccarello avatar May 10 '16 18:05 aciccarello

I'm going to commit https://github.com/angular/angular-cli/pull/635 to fix this. I kinda agree with http being part of the base install, but it's a slippery slope; we're going to have a lot of those packages in the angular org and we don't want to include them all in the packages (since most people wouldn't care about them).

IMO http should get an exception as it's fairly close to Angular. We might revisit later on.

hansl avatar May 11 '16 00:05 hansl

Closed with #635 .

hansl avatar May 11 '16 00:05 hansl

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.