errors appear in console every time I install an npm package and than i have to restore a backup

371 Views Asked by At

I am using smartAdmin to build an application. Whenever i install any package from npm and than try to run the app with

ng serve

it starts giving errors and I am unable to solve these errors and I have to restore some backup always.

recently I installed ngx-device-detector with

npm install ngx-device-detector --save

and than i run the application with

ng serve --open and the following errors appeared on the console.

ERROR in Metadata version mismatch for module D:/ob/Admin/ccAngular/node_modules/ngx-device-detector/ngx-device-detector.d.ts, found version 4, expected 3, resolving symbol HomeModule in D:/ob/Admin/ccAngular/src/app/home/home.module.ts, resolving symbol HomeModule in D:/ob/Admin/ccAngular/src/app/home/home.module.ts, resolving symbol HomeModule in D:/ob/Admin/ccAngular/src/app/home/home.module.ts

ERROR in ./~/jquery/lib/node-jquery.js
Module not found: Error: Can't resolve 'location' in 'D:\ob\Admin\ccAngular\node_modules\jquery\lib'
 @ ./~/jquery/lib/node-jquery.js 13:24-43
 @ ./src/lib.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

ERROR in ./~/jquery/lib/node-jquery.js
Module not found: Error: Can't resolve 'navigator' in 'D:\ob\Admin\ccAngular\node_modules\jquery\lib'
 @ ./~/jquery/lib/node-jquery.js 17:25-45
 @ ./src/lib.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

ERROR in ./~/xmlhttprequest/lib/XMLHttpRequest.js
Module not found: Error: Can't resolve 'child_process' in 'D:\ob\Admin\ccAngular\node_modules\xmlhttprequest\lib'
 @ ./~/xmlhttprequest/lib/XMLHttpRequest.js 15:12-36
 @ ./~/jquery/lib/node-jquery.js
 @ ./src/lib.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

ERROR in ./~/jsdom/lib/jsdom/living/xmlhttprequest.js
Module not found: Error: Can't resolve 'child_process' in 'D:\ob\Admin\ccAngular\node_modules\jsdom\lib\jsdom\living'
 @ ./~/jsdom/lib/jsdom/living/xmlhttprequest.js 4:18-42
 @ ./~/jsdom/lib/jsdom/browser/Window.js
 @ ./~/jsdom/lib/jsdom.js
 @ ./~/jquery/lib/node-jquery.js
 @ ./src/lib.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
webpack: Failed to compile.

please help me solve this issue.

0

There are 0 best solutions below