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\KevinAppData\Roaming\npm\node_modules\@angular\cli
\node_modules\@angular\core\bundles\core.umd.js:7:85)
at Object.
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\KevinAppData\Roaming\npm\node_modules\@angular\cli\node_modules
\@angular\compiler\bundles\compiler.umd.js:7:85
at Object.
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.
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.
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.
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.
lar\cli\models\webpack-configstypescript.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.
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.
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.
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.
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\KevinAppData\Roaming\npm\node_modules\@angular\cli\commands\hel
p.js:29:33
at Array.reduce (native)
at Class.run (C:\Users\KevinAppData\Roaming\npm\node_modules\@angular\cli\c
ommands\help.js:27:39)
at Class.
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
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.
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?
Have you guys tried npm install -g rxjs
?
@AmarildoK But I didn't try to compile the project just invoked 'ng help'?
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
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
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
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.
I followed @dahang instructions and changed the dev dependencies and it works. Though I don't seem to get the warning that dahang describes.
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
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",
There is now a PR to fix the loader warnings: https://github.com/angular/angular-cli/pull/4435
Steps to resolve Issue,
npm uninstall @angular/cli -g
npm install rxjs -g
npm cache clean
npm install @angular/cli -g
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:
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.
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.
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
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 We need to fix cli-dot-angular-dot-io, please do not link there for the time being.
@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
yesterday works, today not works :-/
@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.
npm install -g rxjs
resolved this issue. But still getting warning "fallbackLoader option has been deprecated - replace with "fallback"
".
I am also getting the Cannot find module 'rxjs/symbol/observable'
after ng help
. Does rxjs have to be installed globally?
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.
Any idea on what to do for an Ionic 2 project?
-----------------------------------------From: "Tobias Fuhrimann"
To: "angular/angular-cli"
Cc: "KevinBurton", "Author"
Sent: 09-Feb-2017 06:37:27 +0000
Subject: Re: [angular/angular-cli] ng beta 30 fails (#4425)
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.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub [1], or mute the
thread [2].
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/angular/angular-cli","title":"angular/angular-cli","subtitle":"GitHub
repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open
[3] in
GitHub","url":"https://github.com/angular/angular-cli"}},"updates":{"snippets":[{"icon":"PERSON","message":"@mastertinner
[4] in #4425: 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."}],"action":{"name":"View
Issue","url":"https://github.com/angular/angular-cli/issues/4425#issuecomment-278559823"}}}
[5]
[1]
https://github.com/angular/angular-cli/issues/4425#issuecomment-278559823
[2]
https://github.com/notifications/unsubscribe-auth/AChWbo3ifLrkKBJkHDx9JiMO86lrn1RHks5rarQmgaJpZM4L260z
[3]
https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png
[4] https://github.com/angular/angular-cli
[5]
https://github.com/angular/angular-cli/issues/4425#issuecomment-278559823
It was worked for me. You can try
npm install rxjs -g
update angular version >=2.3.1 in package.json
npm install
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 ?
As soon as https://github.com/angular/angular-cli/pull/4473 is merged, all you need is npm install -g @angular/cli
.
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.
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.
@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.
The new release (beta.32-3) has fixed these missing deps.
issue not fixed with beta.32-3, still the same message, but app works fine ,
@markgoho
npm install -g rxjs
Like a charm. Explain?
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._
Most helpful comment
Steps to resolve Issue,
npm uninstall @angular/cli -g
npm install rxjs -g
npm cache clean
npm install @angular/cli -g