Angular-cli: Ng Serve fails at 95% - TypeError: callbacks[i] is not a function

Created on 8 Feb 2018  ·  184Comments  ·  Source: angular/angular-cli

Versions

Angular CLI: 1.6.8
Node: 9.5.0
OS: darwin x64
Angular: 5.2.4
@angular/cli: 1.6.8
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0

  MacOS High Sierra 10.13.3

Repro steps

MacBook-Pro:~ daniel$ ng new test-proj
...
Installed packages for tooling via npm.
Successfully initialized git.
Project 'test-proj' successfully created.

MacBook-Pro:~ daniel$ cd test-proj/

MacBook-Pro:test-proj daniel$ npm install
up to date in 6.008s

MacBook-Pro:test-proj daniel$ ng serve

Observed behavior

** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
 95% emitting/Users/daniel/test-proj/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40
        callbacks[i](err, result);
                    ^

TypeError: callbacks[i] is not a function
    at Storage.finished (/Users/daniel/test-proj/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40:15)
    at /Users/daniel/test-proj/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:77:9
    at /Users/daniel/test-proj/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:167:5)

Desired behavior

For build to be 100% successful and served to browser

critical 0 (critical) bufix faq

Most helpful comment

npm install [email protected] solved the problem

All 184 comments

The same here

Same issue here

Linked to #9549

Same here :(

Show we revert to a previous version?

Same here yesterday it worked but today I m also getting same error.

same. just got this error today.

First time I'm trying Angular. Not a good day lol

I'm in the same boat with @pedrokelvin

Same!

Same here - it was working fine on yesterday.
My setup:

Angular CLI: 1.5.5
Node: 8.9.4
OS: win32 x64
Angular: 5.2.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.5
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.5
@schematics/angular: 0.1.17
typescript: 2.7.1
webpack: 3.8.1

I have the same problem.

.../node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40
        callbacks[i](err, result);
                    ^
TypeError: callbacks[i] is not a function

Versions

@angular/core": "^5.2.4
@angular/cli": "^1.6.8
Node 9.4.0

Dependencies

"webpack": "3.10.0",
"enhanced-resolve": "3.4.1",

Please use reactions for "me too" comments. My inbox would appreciate it, thanks!

Me too

Me too

Me too

Me too.
But, could not get it working even with the previous version

@skorunka tried the same — didn't work for me

# ng --version

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.6.7
Node: 9.3.0
OS: darwin x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.7
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.7
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0
# ng serve

** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
 95% emitting/Users/nide/Code/hubs/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40
        callbacks[i](err, result);
                    ^

TypeError: callbacks[i] is not a function
    at Storage.finished (/Users/nide/Code/hubs/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40:15)
    at /Users/nide/Code/hubs/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:77:9
    at /Users/nide/Code/hubs/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:167:5)

Looks like something is superbroken, but i don't know what to do. I tried to downgrade cli to 1.6.7 but it didn't work.
People is having the same problem even with CLI 1.5, so i think this might be an Angular problem, not only CLI.

https://github.com/angular/angular-cli/blob/8ff95333aee20b946b55ec2f959b41cd4608401d/package.json#L59

Those who use semver are probably big fans of issues described in this thread.

  • Stop using semver!
  • setup greenkeeper or similar software.

same problem here... we are blocked on so many levels!

same for me

same problem here too... :(

some other deps prevent me from using 1.6.6 which worked until today.
so the issue might have gotten pulled in from the outside, I hate the way npm resolves, and even pinning 1.6.6 in my package.json results in 1.6.8 being installed

same problem here :(

A rollback to ~1.3.0 in your package.json fixes the issue for me as it removes the dependency on copy-webpack-plugin but it's not exactly something I want to keep long term.

Same here and I had the same problem last month with angular-cli 1.5.x (but a different issue: angular-devkit/core not found).
Now I'm using 1.6.6 but it worked until yesterday

same for me!

Angular CLI: 1.5.5
Node: 6.11.0
OS: win32 x64
Angular: 4.4.6
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, tsc-wrapped

@angular/cli: 1.5.5
@angular-devkit/build-optimizer: 0.0.41
@angular-devkit/core: 0.0.28
@angular-devkit/schematics: 0.0.51
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.5
@schematics/angular: 0.1.16
typescript: 2.6.2
webpack: 3.8.1

Same here

I have same problem :(

same problem when update to 1.6.8

Rolling back copy-webpack-plugin to 4.3.0 works.

Same problem. [offtopic] This whole system with 10000 needed packages and semversioning not used properly feels like such a pain in the ass... [/offtopic]

Can confirm the same here - it's holding up our release today

Downgrading isn't working for me.

@neshkatrapati works perfectly now!

its working when i downgrade to 1.3.2

@angular/cli: 1.3.2
node: 9.2.1
os: linux x64
@angular/animations: 5.2.0
@angular/common: 5.2.0
@angular/compiler: 5.2.0
@angular/core: 5.2.0
@angular/forms: 5.2.0
@angular/http: 5.2.0
@angular/platform-browser: 5.2.0
@angular/platform-browser-dynamic: 5.2.0
@angular/router: 5.2.0
@angular/cli: 1.3.2
@angular/compiler-cli: 5.2.0
@angular/language-service: 5.2.0

Same for me

95% emitting/vagrant/talis/shipshape-app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40
        callbacks[i](err, result);
                    ^

TypeError: callbacks[i] is not a function
    at Storage.finished (/vagrant/talis/shipshape-app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40:15)
    at /vagrant/talis/shipshape-app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:77:9
    at /vagrant/talis/shipshape-app/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:154:5)

./node_modules/.bin/ng --version                                                                                                                
Angular CLI: 1.6.5
Node: 8.6.0
OS: darwin x64
Angular: 5.2.2
... common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router

@angular/cdk: 5.1.0
@angular/cli: 1.6.5
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.5
@schematics/angular: 0.1.17
typescript: 2.6.2
webpack: 3.10.0

@MadeRelevant U'r so right.. i think this is critical, the Angular team should fix this as fast as possible. Downgrading from 1.6.8 to 1.3.2 is a sad solution even if works.

Downgrading to 1.3.2 is not an option for me:
ERROR in Please update @angular/cli. Angular 5+ requires at least Angular CLI 1.5+

There may be some kind of evil hiding behind the angular's backend.

Same problem here how to resolved it

95% emitting/home/suraj/Desktop/Untitled Folder/my-app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40
callbacksi;
^

TypeError: callbacks[i] is not a function
at Storage.finished (/home/suraj/Desktop/Untitled Folder/my-app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40:15)
at /home/suraj/Desktop/Untitled Folder/my-app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:77:9
at /home/suraj/Desktop/Untitled Folder/my-app/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:167:5)

"copy-webpack-plugin": "^4.1.1" is causing the issue. A new version of copy-webpack-plugin (4.4.0) is what broke angular cli.

npm install [email protected] solved the problem

I can confim that downgrade of copy-webpack-plugin to 4.3.1 works for me (angular 5.2.3 & 5.2.4 /cli 1.6.6 &1.6.8).
Thanks, @neshkatrapati

Root issue is webpack-contrib/copy-webpack-plugin#217

No way, it works! copy-webpack-plugin caused it for me to. What I am wondering is how was this figured out that it was that package? Trial and error?

And how is it possible that a non-major upgrade causes this issue? Semversioning is not to be trusted within the javascript world I guess..

Me too

Solved by command : npm install [email protected]

thanks @danielszenasi that fix the problem

npm install [email protected]

Thought it was just me thanks @danielszenasi

Im using Angular 4.4.6 (CLI 1.5.0) and the fix from @danielszenasi didn't worked for me.

@danielszenasi solution works for me, I just wasted whole day because of this issue,

This does raise the question of how dependencies are managed in the project. Maybe the use of ^ isn't the best choice.

npm install [email protected] worked for me

I worked for me too

I have more or less come to the same conclusion ^ on its own is worse than hell and npm together

Had the same issue. Resolved by npm install [email protected].

I have same problem for new install

@danny95djb @DooMMasteR It's probably better if the package pins dependencies at specific versions. The "beauty" of npm is that this problem can occur at any level of dependencies, so it's not a 100% safe solution.

Had the same issue. Resolved by npm install [email protected]. angular-cli installed [email protected] which somehow breaks angular-cli.

angular cli: 1.6.8
node: 6.11.5
os: win 10
angular : 4.4.6

Thanks @neshkatrapati

worked for me too... thanks guyz... tired of these breaking changes lately :-/

@hnrchrdl

+1

This also works for me

Thanks @danielszenasi that fix the problem

cmd : npm install [email protected]

Angular CLI: 1.6.6
Node: 8.9.4
OS: linux x64
Angular: 5.2.4

God bless u man @danielszenasi

The same here

thanks

Thanks, @danielszenasi, I just updated my Gitlab CI with "npm install [email protected]" and everything works fine!!!

but... the people that have solved the problem: u had installed copy-webpack-plugin before?
With this the problem not is solved for me :(

TypeError: callbacks[i] is not a function 13:35:39 at Storage.finished (/home/jenkins/.jenkins/workspace/ckend_mcdonalds-cms_develop-KUGBU6RPL4XOVDQHQ263X6SXIV33TJD4ZP4ZTNWQABGBLS2LSMLQ/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40:15) 13:35:39 at /home/jenkins/.jenkins/workspace/ckend_mcdonalds-cms_develop-KUGBU6RPL4XOVDQHQ263X6SXIV33TJD4ZP4ZTNWQABGBLS2LSMLQ/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:77:9 13:35:39 at /home/jenkins/.jenkins/workspace/ckend_mcdonalds-cms_develop-KUGBU6RPL4XOVDQHQ263X6SXIV33TJD4ZP4ZTNWQABGBLS2LSMLQ/node_modules/graceful-fs/polyfills.js:287:18 13:35:39 at FSReqWrap.oncomplete (fs.js:123:15)

does npm install [email protected] command have to be ran with --save or --save dev?

same here like @mcanelo

@jbarber2016
npm install --only=dev [email protected]

@danielszenasi, the Nobel Peace Prize goes for you, man :)

Thanks a lot!

@mcanelo
Check if you have ^ in package.json, remove it to force to downgrade the package if you use npm install in a jenkins task

Thanks ;) @danielszenasi

same here on windows 10

npm install [email protected]

Is functional for me too. By installing npm 5+ and making package-lock.json on that version solved problem on whole building system. Thanks for that advice.

awesome stuff thanks

npm install [email protected]

worked for me, if executed from project folder.

thanks @danielszenasi

npm install [email protected] worked for me. Thank you!!!

Funcionó con la degradacion de webpack...pero en serio...como ha podido llegar a pasar esto? Increible...

4.3.0 doesn't work for me, 4.3.1 does work.

We currently investigate problem https://github.com/webpack-contrib/copy-webpack-plugin/issues/217, please don't spam. Thanks.

I've the same error here:

Jenkins (running a slave container):
image

Local (running the same container that Jenkins):
image

And it seems that @ReToCode build also has the same issue:
https://travis-ci.org/oscp/openshift-monitoring/builds/338959033?utm_source=github_status&utm_medium=notification

Thanks ;) @danielszenasi . That worked for me.

@losbeekos's solution has worked.

As I'm releasing a version today, I'll keep this workaround for now.

Worked for me, tnx to all!
_npm install [email protected] --save_
p.s. I had to put --save to add to package/json
Fwi, is this temp solution, or?

Thank u @danny95djb and @danielszenasi! 4.3.1 does work for me

@idukic temp solution, because that package is at 4.4.0 and that's what broke the current setup

Remove "favicon.ico" from .angular-cli.json in "assets" field solve problem.
Investigate more deeply why it is happens

Same issue :(

D:a1s*node_modulesenhanced-resolvelibCachedInputFileSystem.js:40
callbacksi;
^
TypeError: callbacks[i] is not a function
at Storage.finished (D:a1s*
node_modulesenhanced-resolvelibCachedInputFileSystem.js:40:15)
at D:a1s*node_modulesenhanced-resolvelibCachedInputFileSystem.js:77:9
at D:a1s*
node_modulesgraceful-fspolyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:153:5)

For me adding "copy-webpack-plugin": "4.3.1" to package.json solved the problem. Thanks guys

same here

For Yarn users, you can override the copy-webpack-plugin version used inside CLI by adding this to your package.json:

  "resolutions": {
    "copy-webpack-plugin": "4.3.0"
  }

The semantics of this are slightly different than just manually overwriting the version once, you're telling yarn "if anything I am using depends on this package, ignore what version it thinks it wants and give it this one instead".

@MartynasStukas this will not work as you wanted to. If you are on localhost it's ok but if you use gitlab-ci to build your project this solution is messy. Yes, it's a workaround for now, but this is not the desired solution. Desired solution is to hit npm install and to work without installing other libraries.

"@angular/cli": "1.6.1", angular 5.0.0: solution using copy-webpack-plugin not working for me

same problem. npm install [email protected] fix for me

angular/cli: 1.6.8
angular/material: 2.0.0-beta.12
angular-devkit/build-optimizer: 0.0.42
angular-devkit/core: 0.0.29
angular-devkit/schematics: 0.0.52
ngtools/json-schema: 1.1.0
ngtools/webpack: 1.9.8
schematics/angular: 0.1.17
typescript: 2.3.3
webpack: 3.10.0

Resole with this command : npm install [email protected]

Thanks

I also want write story & participate in this issue, which received the largest nb. of comments within one hour!

npm install [email protected] --save
worked for me

[email protected] didn't help

clean project with ng new, all latest angular stuff, wont work either

Same issue.
I tested "npm install [email protected]" and it works for me. (localhost project)

also ng test --code-coverage --single-run doesn't work anymore

TypeError: Cannot read property 'apply' of undefined

lets go have a drink then come back :)

Thanks @danielszenasi ! That worked for me. :)

For anybody using Gitlab with yarn, you'll need to add a script line after "yarn install":

- npm install [email protected]

This fixed it for me

Hi all,

@evilebottnawi is looking into this from the webpack side, and I am looking at it from the CLI side.

It seems to be a bad interaction in usage of the webpack file system. I don't yet have more details than that but we are looking into this.

There's already a couple of suggestions on how to work around for now but I will reiterate for visibility: you can try to force install [email protected] in your project.

Using npm, follow these steps:

I used npm 5.6.0 for this, and recommend you use at least that version as well since it has lockfile support and solves some npm problems with windows.

@kylecordes has also offered some advice for Yarn users in https://github.com/angular/angular-cli/issues/9550#issuecomment-364110779.

I'd like to remind everyone that you only have reproducible installs if you use a lockfile. Both NPM v5+ and Yarn support lockfiles. If your CI works one day but not the next and you did not change your code or package.json, it is likely because one of your dependencies had a bad release and you did not have a lockfile.

It is your responsibility as a library consumer to use lockfiles. No one wants to do a release with bugs but it sometimes happens, and the best we can do is to fix it as fast as possible with a new release. When you have a couple of thousand total dependencies it is only a matter of time until one of them has a bad release.

Same Here!

capture

Same problem.... version 1.6.7

npm install --save [email protected] Worked for us.

We are running Visual Studio Builds for Angular App. This is out setup:

image

Can anyone direct me to a resource that details implementing this fix on an Azure web app through VSTS?

Workaround suggested by @MartinManchev worked fine for me!!

"npm install [email protected]"

Worked for me
npm install [email protected] --save

npm install [email protected] solve my issue

I had the same problem, but the solution npm install [email protected] worked for me.

thanks @danielszenasi

SAME ERROR HERE

Angular CLI: 1.6.7
Node: 6.9.4
OS: win32 x64
Angular: 5.2.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

angular/cli: 1.6.7
angular-devkit/build-optimizer: 0.0.42
angular-devkit/core: 0.2.0
angular-devkit/schematics: 0.0.52
ngtools/json-schema: 1.1.0
ngtools/webpack: 1.9.7
schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0

Me too

npm install package@version still adds semver ranges and didn't help in my case, so I used -E option to use an exact version. Additionally using option -O to add the plugin to peer dependencies only, as the webapp doesn't depend directly on copy-webpack-plugin. Solution described here: https://stackoverflow.com/a/48687139/3120193

thanx @danielszenasi,i fixed the problem

I had to use the resolutions fix proposed above in comment https://github.com/angular/angular-cli/issues/9550#issuecomment-364110779

npm install [email protected] --save (worked for me)

thanks @danielszenasi 👍

Thanks!!!!

same here! I'm going to try this npm install [email protected] --save

Same problem here with ng build but I have a question about this. Should I add copy-webpack-plugin to my package.json ?

I guess not, we don't want temporary solutions in package json...

@stoto34, you do that by adding '--save '
_npm install [email protected] --save_

works for me!!! --> npm install [email protected] --save

@idukic If I remove node_modules folder when I build my app, I will have the same problem for the next build right ? (FIY, it's all about production server)

thanks @danielszenasi

npm install [email protected] --save (worked! ty)

This is embarrassing.

Running npm install [email protected] worked for me, thank you for the comments!!

@anilbobba1 Thanks, your pic helped me a great deal.

I have the same problem with Angular 5 and CLI 1.6.7. And it just happened today, yesterday everything worked perfectly.

npm install [email protected] --saveDev worked for me too

same problem and solution, be patient fellow web developers the time is coming where we wont need to write a single line of javascript or compile to it. It is called webassembly....

Yeah it is working indeed but i am not sure that this is a good solution anyway.... hope it will be fixed soon

Solution using npm install [email protected] --save not working for me

After doing the npm install copy-webpack I get
Module build failed: Error: Cannot find module 'cuint'
Seems apt

npm install [email protected] works also here. many thanks

npm install [email protected]
Will this work for our project as below version
"@angular/cli": "1.6.1",
"@angular/compiler-cli": "5.1.1",
"typescript": "2.4.2"?

Same problem here

Thanks @danielszenasi ! That worked for me.

npm install [email protected]

npm install [email protected] --save didn't work for my case! Any other solution, please?

npm install [email protected] -save worked. many thanks

You should not --save the module to your project.json, because it is only a temporary fix. Instead, use a lock file. Read the explanations from @filipesilva above.

npm install [email protected] -save didn't help in my case

if npm install [email protected] doesn`t help try add in package.json:

"optionalDependencies": {
"copy-webpack-plugin": "4.3.1"
},
"resolutions": {
"copy-webpack-plugin": "4.3.1"
}

Have fix https://github.com/webpack-contrib/copy-webpack-plugin/pull/221, just wait release in near minutes

Same issue here on Bash windows

What do I need to do exactly once webpack-contrib/copy-webpack-plugin#221 has passed Travis-CI?

Same

hi guys, i add in my package.json
...
"copy-webpack-plugin": "4.3.0",
...
and solved my problems!

I get the same problem when deploying to Heroku.

Hi, @maicongobbi
Will this work for below version
"@angular/cli": "1.6.1",
"@angular/compiler-cli": "5.1.1",
"typescript": "2.4.2"?

OK IT WORKED

THANKS

node v9.3.0
npm 5.6.0

"@angular/cli": "1.6.8",
"@angular/compiler": "^5.2.0",
"typescript": "^2.6.2",
"@types/node": "^9.4.2",
"copy-webpack-plugin": "^4.4.1",

the new copy-webpack-plugin rev fixes it

thank you mate

@amithole1987
"typescript": "^2.5.3",
"@angular/cli": "^1.6.0",
"@angular/compiler-cli": "^4.4.5",

it seems to work now!

Now arrived v4.4.1 💃
https://www.npmjs.com/package/copy-webpack-plugin
Now it hasn't this bug!

$ npm install [email protected]
This command worked for me..

Hi all,

[email protected] was just released with a fix that addresses this problem (https://github.com/webpack-contrib/copy-webpack-plugin/pull/221).

A big thanks to the Webpack folks, especially @evilebottnawi, for looking investigating this problem and releasing a new version so quickly.

Using npm, follow these steps to force update:

I used npm 5.6.0 for this, and recommend you use at least that version as well since it has lockfile support and solves some npm problems with windows.

@kylecordes has also offered some advice for Yarn users in https://github.com/angular/angular-cli/issues/9550#issuecomment-364110779.

I'd like to remind everyone that you only have reproducible installs if you use a lockfile. Both NPM v5+ and Yarn support lockfiles. If your CI works one day but not the next and you did not change your code or package.json, it is likely because one of your dependencies had a bad release and you did not have a lockfile.

It is your responsibility as a library consumer to use lockfiles. No one wants to do a release with bugs but it sometimes happens, and the best we can do is to fix it as fast as possible with a new release. When you have a couple of thousand total dependencies it is only a matter of time until one of them has a bad release.

I am going to close this topic for now so that my answer will be the most visible for anyone experiencing this issue.

I'm sorry to remove your ability to comment on it but for new users it would be very hard to find the solution with so many comments coming up. I will reopen in a few hours.

Leaving issue opened for now to increase visibility, but will close later when reopening comments. For any new users coming into this issue, please check my comment just above regarding the resolution.

the only way to resolve this issue is to use a previous version of the @angular/cli. Which is version 1.6.1 and before

I have only been able to solve this as well by reverting version of @angular/cli to 1.60 or 1.6.1.
I have this issue for more clarity but relates to the topic here:
TypeError: fromJSON_1.default is not a function

Uninstall and reinstall angular cli again. Issue is already solved

This has been solved by a new release of the copy webpack plugin.

With me, works only after reinstalling @angular/cli and, in addition, delete package-lock.json, remove node_modules and reinstall packages

deleting package-lock.json and npm install [email protected] worked for us. Cheers!!!

So, I was facing the same problem.
What I did

npm uninstall -g @angular/cli
npm cache clean --force
npm install -g @angular/cli

It is working now. Cheers

I made downgrade compiler-cli up to 5.2.3 and I started

After updating and trying build version still got this error
obraz

npm install [email protected] --save

Its Working For Me ..Thanks :)

Hi team, have you planned a patch in the angular-cli in order to fix this issue? thank you in advance.

@albertnadal a patch isn't required to fix this issue as it was to do with a dependency which has now fixed, npm install / clearing npm cache then installing should fix the issue

npm install [email protected]
Work for Me there are my configuration

Angular CLI: 1.6.8
Node: 8.9.4
OS: win32 x64
Angular: 5.2.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

angular/cli: 1.6.8
angular-devkit/build-optimizer: 0.0.42
angular-devkit/core: 0.0.29
angular-devkit/schematics: 0.0.52
ngtools/json-schema: 1.1.0
ngtools/webpack: 1.9.8
schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0

Thank's

so error was in in third party lib "copy-webpack-plugin": "^4.1.1",
if angular-cli team hard coded dependency like "copy-webpack-plugin":"4.1.1"
this error would not happened
in this case authors of code-webpack-plugin would not know so fast that they have error in one release

so maybe npm community need to be less optimistic about semantic versioning
and to remove tildes and carets from package json in order to have more robust
predicable builds

angular can start first and lets hope that other npm projects will follow

it is not first (last) time this stuff happened it could be even worst
that some deeper dependency broke build
cure is simple in all packege.json remove tildes and and carets
use https://www.npmjs.com/package/npm-check-updates to manually manage project dependencies
run ncu - u
run npm i
run all tests and if it is OK publish

another option is maybe to have in npm option to run it without semantic versioning
without tildes and carets so if somebody
does not want to test semantic versioning he can do it with
for example command
npm i --stable
where npm could install version without tildes and carets
maybe it already exitst but nobody use it or know about it

of course this is not ng cli problem it is general problem with semantic versioning

angular team is doing great job and lets hope that they will attack
problem to have more robust builds

svega ovoga nebi bilo da je pera otisao u policiju

@topce upravu si svega ovoga nebi bilo 😂

After a new installation and package update from package.json, "ng test" still gives errors.

The following solutions, found on Internet, did not work for me:

  • move "import 'zone.js / dist / zones-testing';" at the end of the imports on test.ts file;
  • uninstalling and reinstalling "@ angular / cli";
  • deleting node-modules, package-lock.json and reinstalling all with "npm install";
  • install the copy-webpack-plugin package;

The only good option was to downgrade "jasmine-core" to "2.99.0"

Here are the dependencies used:

"dependencies": {
"@angular/animations": "^5.2.7",
"@angular/common": "^5.2.7",
"@angular/compiler": "^5.2.7",
"@angular/core": "^5.2.7",
"@angular/forms": "^5.2.7",
"@angular/http": "^5.2.7",
"@angular/platform-browser": "^5.2.7",
"@angular/platform-browser-dynamic": "^5.2.7",
"@angular/router": "^5.2.7",
"core-js": "^2.5.3",
"rxjs": "^5.5.6",
"zone.js": "^0.8.20"
},
"devDependencies": {
"@angular/cli": "^1.7.2",
"@angular/compiler-cli": "^5.2.7",
"@angular/language-service": "^5.2.7",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~9.4.6",
"codelyzer": "^4.2.1",
"jasmine-core": "~2.99.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.4.1",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.6.2"
}

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._

Was this page helpful?
0 / 5 - 0 ratings