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

ERROR [preprocess]: Can not load "webpack"! TypeError: Cannot read property 'plugin' of undefined

Open ravidannani opened this issue 9 years ago • 6 comments

After installing angular cli, I ran the below commands and able to open the application on browser. ng new my-dream-app cd my-dream-app ng serve

But inorder to do testing, executed ng test command, but getting the below issue. Not sure how to proceed further.

image

Could you please let me know if i did any mistake.

ravidannani avatar Aug 19 '17 23:08 ravidannani

I ran into this same issue. I was able to add

"@ngtools/webpack": "^1.6.2"

to the devDependencies as a fix for a newly generated project but this temp fix did not work with another recently created app I developed. I read about adding a tsconfig.spec.ts as a fix as well here: https://github.com/angular/angular-cli/issues/6457

Currently still unable to fix my issue.

ebuychance avatar Aug 25 '17 00:08 ebuychance

+1

amrography avatar Aug 25 '17 13:08 amrography

ng -v
angular-cli: 1.0.0-beta.28.3
node: 8.3.0
os: win32 x64

Upgrading to @angular/cli: 1.3.2 solved my issues.

ebuychance avatar Aug 25 '17 17:08 ebuychance

It appears you have a much older version of the CLI (still using the package name angular-cli)

You will want to remove that package and install the current version...

npm uninstall angular-cli -g
npm install @angular/cli -g

Also, you'll want to ensure your versions are up to date, which you can find under prerequisites

Brocco avatar Aug 29 '17 13:08 Brocco

I got burned by this as well. I did see the message when running ng test which said

As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release,

However, I read this as a forewarning about something that would happen in the future, where I should have read it as something which was in the near-future of the long-ago-past, which means it's still in the past from where the present currently is.

It would have been better if whoever typed the "forewarning" instead said something like "As of DATE, the angular-cli repository is deprecated and you should be using @angular/cli"

uglycoyote avatar Nov 15 '17 06:11 uglycoyote

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.