Skip to content
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

ng beta 30 fails #4425

Closed
KevinBurton opened this issue Feb 3, 2017 · 37 comments
Closed

ng beta 30 fails #4425

KevinBurton opened this issue Feb 3, 2017 · 37 comments

Comments

@KevinBurton
Copy link

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

@AmarildoK
Copy link

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.

@maschad
Copy link

maschad commented Feb 4, 2017

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?

@markgoho
Copy link
Contributor

markgoho commented Feb 4, 2017

Have you guys tried npm install -g rxjs?

@KevinBurton
Copy link
Author

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

@gabemasiulis
Copy link

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

@strayobject
Copy link

strayobject commented Feb 4, 2017

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

@dahang
Copy link

dahang commented Feb 4, 2017

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

@BaggersIO
Copy link

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.

@AmarildoK
Copy link

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

@strayobject
Copy link

strayobject commented Feb 4, 2017

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

@rodrijuarez
Copy link

rodrijuarez commented Feb 4, 2017

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",

@Splaktar
Copy link
Member

Splaktar commented Feb 5, 2017

There is now a PR to fix the loader warnings: #4435

@sslgeorge
Copy link

sslgeorge commented Feb 5, 2017

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

@maxime1992
Copy link
Contributor

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 👍

@jsBrian
Copy link

jsBrian commented Feb 6, 2017

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.

@victorpigmeo
Copy link

victorpigmeo commented Feb 6, 2017

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.

@alexweber
Copy link

alexweber commented Feb 6, 2017

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: #4427 (comment)

@catull
Copy link
Contributor

catull commented Feb 6, 2017

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.

@hansl
Copy link
Contributor

hansl commented Feb 6, 2017

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

@HauntedSmores
Copy link

@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

@ewiggin
Copy link

ewiggin commented Feb 8, 2017

yesterday works, today not works :-/

@maxime1992
Copy link
Contributor

@ewiggin I had a similar (strange) behaviour.

But I figured out that I switched from a branch which was not on beta.30 and it probably do that because angular-cli.json have an unexpected version. Make sure you clean your node_modules and that you're in a branch upgraded to beta.30.

@adrianbarbe
Copy link

adrianbarbe commented Feb 8, 2017

npm install -g rxjs resolved this issue. But still getting warning "fallbackLoader option has been deprecated - replace with "fallback"".

@JanStureNielsen
Copy link

@adrianbarbe -- see http://stackoverflow.com/questions/42076879/fallbackloader-option-has-been-deprecated-replace-with-fallback

@victormejia
Copy link

I am also getting the Cannot find module 'rxjs/symbol/observable' after ng help. Does rxjs have to be installed globally?

@cloudlena
Copy link

I think the issue is with projects that have been generated with angular-cli and you're trying to operate on with an @angular/cli. For me, the problem got resolved when I ran ng update [options] (where the options are the same ones I used during ng new. That updates the project to use the new @angular/cli which should resolve the problem. Installing rxjs globally should only be used as a temporary workaround since it's not a good idea.

@KevinBurton
Copy link
Author

KevinBurton commented Feb 9, 2017 via email

@dinhduongrestaff
Copy link

dinhduongrestaff commented Feb 9, 2017

It was worked for me. You can try
npm install rxjs -g
update angular version >=2.3.1 in package.json
npm install

@KevinBurton
Copy link
Author

So to summarize what I understand. In order to get beta-30 to work you have to 'npm install rxjs -g' (so you don't get an error with 'ng help')? If you have created a project then use 'ng update' @mastertinner. RIght ?

@catull
Copy link
Contributor

catull commented Feb 9, 2017

As soon as #4473 is merged, all you need is npm install -g @angular/cli.

@DeveloperAlex
Copy link

My "ng build" was failing too. To fix this I created a temp folder and ran "ng new tempapp".

Then I copy/pasted in the updates to tempapp's package.json file to my app's package.json file (careful not to remove any additional packages I've added to customize my app). Then I deleted my node_modules folder. And ran "npm install".

That fixed the problem.

@catull
Copy link
Contributor

catull commented Feb 14, 2017

Another approach is to perform ng init in your current app.

It will suggest to over-write many generated files; be extra careful.
Basically you want to only say "yes" to "Do you want to overwrite package.json", and "no" to most other questions.
Once through, you'd have to perform ng update and you're done.

But, your alternative worked too, and that is all that matters.

@KevinBurton Now that there is a newer version out, this is what you can do now:
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli

The dependency of rxjs is now properly dealt with.
It was fixed with PR #4473.

Please confirm that this solution works for you.

@Meligy
Copy link
Contributor

Meligy commented Feb 15, 2017

@catull FYI, ng init and ng update are the same command.
And it has been removed in master already.

Currently moving from earlier betas, the supported path is creating ng new app and ensuring you have everything from it similar to docs Moving your project to Angular CLI.

Going forward, for future RCs and beta(s) if any, specific / manual upgrade steps will be documented in the Changelog.

@filipesilva
Copy link
Contributor

The new release (beta.32-3) has fixed these missing deps.

@da45
Copy link

da45 commented Feb 20, 2017

issue not fixed with beta.32-3, still the same message, but app works fine ,

@p0ma
Copy link

p0ma commented May 30, 2017

@markgoho

npm install -g rxjs

Like a charm. Explain?

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests