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

ng beta 30 fails

Open KevinBurton opened this issue 9 years ago • 37 comments

OS Windows 7 @angular/cli: 1.0.0-beta.30 'ng help' causes: Cannot find module 'rxjs/symbol/observable' Error: Cannot find module 'rxjs/symbol/observable' at Function.Module._resolveFilename (module.js:470:15) at Function.Module._load (module.js:418:25) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at globalScope (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angular\cli \node_modules@angular\core\bundles\core.umd.js:7:85) at Object. (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angu lar\cli\node_modules@angular\core\bundles\core.umd.js:10:2) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at C:\Users\Kevin\AppData\Roaming\npm\node_modules@angular\cli\node_modules @angular\compiler\bundles\compiler.umd.js:7:85 at Object. (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angu lar\cli\node_modules@angular\compiler\bundles\compiler.umd.js:10:2) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angu lar\cli\node_modules@angular\compiler-cli\index.js:12:18) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angu lar\cli\node_modules@ngtools\webpack\src\plugin.js:5:22) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angu lar\cli\node_modules@ngtools\webpack\src\index.js:6:10) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angu lar\cli\models\webpack-configs\typescript.js:3:17) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angu lar\cli\models\webpack-configs\index.js:9:10) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angu lar\cli\models\webpack-config.js:4:25) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angu lar\cli\tasks\build.js:6:24) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angu lar\cli\commands\build.run.js:3:15) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at C:\Users\Kevin\AppData\Roaming\npm\node_modules@angular\cli\commands\hel p.js:29:33 at Array.reduce (native) at Class.run (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angular\cli\c ommands\help.js:27:39) at Class. (C:\Users\Kevin\AppData\Roaming\npm\node_modules@angul ar\cli\ember-cli\lib\models\command.js:134:17) at process._tickCallback (internal/process/next_tick.js:103:7)

During installation rxjs came up as an unmet dependency

KevinBurton avatar Feb 03 '17 23:02 KevinBurton

Same issue. This only happens when you try to compile a project that was created with an older version of cli. I have not been able to find the cause of this.

In the meantime just make new project and copy paste your components etc. to the new project.

AmarildoK avatar Feb 04 '17 00:02 AmarildoK

I am receiving the same issue as well after running npm install -g @angular/cli and then running ng help , I tried a npm install rxjs-es but still getting that error, perhaps it's no longer bundled?

maschad avatar Feb 04 '17 01:02 maschad

Have you guys tried npm install -g rxjs?

markgoho avatar Feb 04 '17 02:02 markgoho

@AmarildoK But I didn't try to compile the project just invoked 'ng help'?

KevinBurton avatar Feb 04 '17 03:02 KevinBurton

I got the same result, then tried markgoho's suggestion. After npm install -g rxjs I was able to ng help and ng new, but I could not ng serve the new Angular project. I came up with quite a long error output:

PS C:\ng\testapp> ng serve
** NG Live Development Server is running on http://localhost:4200. **
Hash: 6a38e9bf99d82af8f7ee
Time: 1192ms
chunk    {0} styles.bundle.js, styles.bundle.map (styles) 28 bytes {3} [initial] [rendered]
chunk    {1} polyfills.bundle.js, polyfills.bundle.map (polyfills) 28 bytes {3} [initial] [rendered]
chunk    {2} main.bundle.js, main.bundle.map (main) 40 bytes [initial] [rendered]
chunk    {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]

ERROR in multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts
Module not found: Error: Can't resolve 'webpack-dev-server/client?http://localhost:4200/' in 'C:\ng\testapp'
 @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in multi ./src/styles.css

Module not found: Error: Can't resolve 'style-loader' in 'C:\ng\testapp'
 @ multi ./src/styles.css

ERROR in multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts
Module not found: Error: Can't resolve '@ngtools/webpack' in 'C:\ng\testapp'
 @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in multi ./src/polyfills.ts
Module not found: Error: Can't resolve '@ngtools/webpack' in 'C:\ng\testapp'
 @ multi ./src/polyfills.ts

ERROR in   Error: Child compilation failed:
  Entry module not found: Error: Can't resolve 'raw-loader' in 'C:\ng\testapp':
  Error: Can't resolve 'raw-loader' in 'C:\ng\testapp'

Continues on for a bit

gabemasiulis avatar Feb 04 '17 03:02 gabemasiulis

I upgraded to .30 on ubuntu 16.04 and created new project run ng serve and got

Error: Cannot find module '@ngtools/json-schema'

after fixing that I'm stuck with:

ERROR in ./src/main.ts Module build failed: TypeError: Cannot read property 'newLine' of undefined [...] ERROR in ./src/polyfills.ts Module build failed: TypeError: Cannot read property 'newLine' of undefined [...]

In case it matters, running node v7.5.0 and npm v4.2.0

strayobject avatar Feb 04 '17 13:02 strayobject

I got same issue. update Package.json :

"devDependencies": {
    "@angular/cli": "1.0.0-beta.30",
    "@angular/compiler-cli": "^2.3.1",

resolve it. and got this waring: fallbackLoader option has been deprecated - replace with "fallback"

I pushed changes to my ng2 D3 scaffold project. https://github.com/dahang/d3-angular2-app.git

dahang avatar Feb 04 '17 14:02 dahang

I made a back up of my source code and package.json / angular-cli.json changes und ran ng init within the buggy project. Follow the init process and replace everything. Now apply your back up to the new project and run ng serve. It should work from now.

Maybe there will be still some missing dependencies which were dropped by the ng init. Add them to your package.json and re-run npm i. Don't forget to change your project settings in angular-cli.json if needed.

BaggersIO avatar Feb 04 '17 14:02 BaggersIO

I followed @dahang instructions and changed the dev dependencies and it works. Though I don't seem to get the warning that dahang describes.

AmarildoK avatar Feb 04 '17 14:02 AmarildoK

For me it did not work. I wanted this update as a solution to .ts file recompile issue, but I managed to solve it by downgrading cli to beta 28.3 and webpack to 1.2.4

strayobject avatar Feb 04 '17 18:02 strayobject

For the warnings indicated by @dahang , I think that line 90 in models/webpack-configs/styles.js should be replaced with: use: [

and line 95 with: fallback: 'style-loader',

Options loader and fallbackLoader are deprecated in a newer version of the library extract-text-webpack-plugin, given that is specified like this: "extract-text-webpack-plugin": "^2.0.0-rc.1",

rodrijuarez avatar Feb 04 '17 21:02 rodrijuarez

There is now a PR to fix the loader warnings: https://github.com/angular/angular-cli/pull/4435

Splaktar avatar Feb 05 '17 05:02 Splaktar

Steps to resolve Issue,

  • Uninstalled angular cli npm uninstall @angular/cli -g
  • Installed rxJS npm install rxjs -g
  • Cleared cache npm cache clean
  • Installed angular cli npm install @angular/cli -g

sslgeorge avatar Feb 05 '17 09:02 sslgeorge

I have many projects based on angular-cli.

I did upgrade one of them and when I decided to work on the other I had this error.

The thing is, I upgraded angular-cli globally from angular-cli.beta.28-3 to @angular/cli beta 30 when I upgraded the first project.

Once I upgraded my second project to @angular/cli beta.30, everything was working just fine :+1:

maxime1992 avatar Feb 05 '17 16:02 maxime1992

I updated the package, so the devDep is @angular/cli beta 30. Removed my node_modules folder and did a fresh NPM install. Worked for my team members and me.

jsBrian avatar Feb 06 '17 10:02 jsBrian

The first line says

Cannot find module 'rxjs/symbol/observable'
Error: Cannot find module 'rxjs/symbol/observable'

use npm install -g rxjs to install rxjs globally. Use sudo if using linux, this should work.

victorpigmeo avatar Feb 06 '17 13:02 victorpigmeo

For anyone getting TypeError: Cannot read property 'kind' of undefined, You can fix it by adding :any to my @Inject() params in constructors as suggested here: https://github.com/angular/angular-cli/issues/4427#issuecomment-277422798

alexweber avatar Feb 06 '17 13:02 alexweber

If you go to https://cli.angular.io/ it states there to perform this installation: npm install -g angular-cli. That way, its dependencies are properly fetched and installed, too.

catull avatar Feb 06 '17 21:02 catull

@catull We need to fix cli-dot-angular-dot-io, please do not link there for the time being.

hansl avatar Feb 06 '17 23:02 hansl

@catull From what I understand angular cli is moving its npm to @angular/cli so that wont work anymore. Thats why on the angular-cli github they tell you to uninstall/upgrade the cli by doing npm uninstall angular-cli @angular/cli

HauntedSmores avatar Feb 07 '17 02:02 HauntedSmores