dir.by  
Поиск >>

Компьютер, программы
→
Angular
 Error "Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js)" 
посмотрели 5093 раз
обновлено: 4 September 2023
In Visual Studio Code when you run the command:
npm run start
or
ng build
Error:
./node_modules/css-loader/dist/runtime/api.js - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Transform failed with 1 error:
error: Invalid version: "15.2-15.3"


./node_modules/css-loader/dist/runtime/noSourceMaps.js - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Transform failed with 1 error:
error: Invalid version: "15.2-15.3"


./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Transform failed with 1 error:
error: Invalid version: "15.2-15.3"


./src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Transform failed with 1 error:
error: Invalid version: "15.2-15.3"


./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Transform failed with 1 error:
error: Invalid version: "15.2-15.3"
at tryRunOrWebpackError (D:\Projs\MyProject1\WEB\node_modules\webpack\lib\HookWebpackError.js:88:9)
at __webpack_require_module__ (D:\Projs\MyProject1\WEB\node_modules\webpack\lib\Compilation.js:4979:12)
at __webpack_require__ (D:\Projs\MyProject1\WEB\node_modules\webpack\lib\Compilation.js:4936:18)
at Module. (D:\Projs\MyProject1\WEB\node_modules\css-loader\dist\cjs.js??ruleSet[1].rules[2].rules[0].oneOf[1].use[1]!D:\Projs\MyProject1\WEB\node_modules\postcss-loader\dist\cjs.js??ruleSet[1].rules[2].rules[0].oneOf[1].use[2]!D:\Projs\MyProject1\WEB\node_modules\@angular\material\prebuilt-themes\deeppurple-amber.css:5:98)
at D:\Projs\MyProject1\WEB\node_modules\webpack\lib\javascript\JavascriptModulesPlugin.js:432:11
at Hook.eval [as call] (eval at create (D:\Projs\MyProject1\WEB\node_modules\tapable\lib\HookCodeFactory.js:19:10), :7:1)
at D:\Projs\MyProject1\WEB\node_modules\webpack\lib\Compilation.js:4981:39
at tryRunOrWebpackError (D:\Projs\MyProject1\WEB\node_modules\webpack\lib\HookWebpackError.js:83:7)
at __webpack_require_module__ (D:\Projs\MyProject1\WEB\node_modules\webpack\lib\Compilation.js:4979:12)
at __webpack_require__ (D:\Projs\MyProject1\WEB\node_modules\webpack\lib\Compilation.js:4936:18)
-- inner error --
Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Transform failed with 1 error:
error: Invalid version: "15.2-15.3"
at Object. (D:\Projs\MyProject1\WEB\node_modules\@angular-devkit\build-angular\src\babel\webpack-loader.js??ruleSet[1].rules[1].use[0]!D:\Projs\MyProject1\WEB\node_modules\@ngtools\webpack\src\ivy\index.js!D:\Projs\MyProject1\WEB\node_modules\css-loader\dist\runtime\noSourceMaps.js:1:7)
at D:\Projs\MyProject1\WEB\node_modules\webpack\lib\javascript\JavascriptModulesPlugin.js:432:11
at Hook.eval [as call] (eval at create (D:\Projs\MyProject1\WEB\node_modules\tapable\lib\HookCodeFactory.js:19:10), :7:1)
at D:\Projs\MyProject1\WEB\node_modules\webpack\lib\Compilation.js:4981:39
at tryRunOrWebpackError (D:\Projs\MyProject1\WEB\node_modules\webpack\lib\HookWebpackError.js:83:7)
at __webpack_require_module__ (D:\Projs\MyProject1\WEB\node_modules\webpack\lib\Compilation.js:4979:12)
at __webpack_require__ (D:\Projs\MyProject1\WEB\node_modules\webpack\lib\Compilation.js:4936:18)
at Module. (D:\Projs\MyProject1\WEB\node_modules\css-loader\dist\cjs.js??ruleSet[1].rules[2].rules[0].oneOf[1].use[1]!D:\Projs\MyProject1\WEB\node_modules\postcss-loader\dist\cjs.js??ruleSet[1].rules[2].rules[0].oneOf[1].use[2]!D:\Projs\MyProject1\WEB\node_modules\@angular\material\prebuilt-themes\deeppurple-amber.css:5:98)
at D:\Projs\MyProject1\WEB\node_modules\webpack\lib\javascript\JavascriptModulesPlugin.js:432:11
at Hook.eval [as call] (eval at create (D:\Projs\MyProject1\WEB\node_modules\tapable\lib\HookCodeFactory.js:19:10), :7:1)
Solution:
Step 1. Open File Explorer and go to the project folder:
 
Open the file .browserslistrc and delete everything inside.

Step 2. Let's try to run the project in Visual Studio Code and there are no errors:
 
← Previous topic
ng serve Error "File ng.ps1 cannot be loaded. The file ng.ps1 is the current system. " | nodejs npm angular
 
Next topic →
Using Docker in a project with Angular (for Windows)
 
Your feedback ... Comments ...
   
Your Name
Your comment (www links can only be added by a logged-in user)

Новость "Черная пятница" Dreame в Беларуси – две недели скидок до 3400 рублей
 
• What is Angular 8?
New Angular 8 application
Option 1. Creating a new Angular application from the console with the angular/cli command (50 files)
• Creating a new web application with Angular 8. Using the command line: npx -p @angular/cli@8.1.0 ng new
Option 2 (the best for me). Creating a new Angular application yourself (8 files)
• Create a new web application with Angular 8 in Visual Studio Code. We use: Node.js + Angular (write our component in ts file) + Typescript (convert files ts to js)
• What happens when I start an Angular 8 application? Run main.ts file. Creating a module.
Angular 9
• Creating a new web application with Angular 9 in Visual Studio Code. Use: Node.js + Angular (write our component in the ts file) + Typescript (convert ts files to js)
Angular 12
• Creating a new web application with Angular 12 in Visual Studio Code. Use: Node.js + Angular (write our component in the ts file) + Typescript (convert ts files to js)
• Adding routing (router) to the web application with Angular 12
Angular Description
• Modules in Angular
• Components in Angular
• Binding data in Angular
Errors
• Error "npm : The term "npm" is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spell included, verify that the path is correct and try again. " | nodejs npm angular
• Error "npm ERR! While resolving: @angular/flex-layout@12.0.0-beta.35 | Could not resolve dependency: | Conflicting peer dependency: @angular/cdk@12.2.13" | nodejs npm angular
• ng serve Error "ng : The term "ng" is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spellin the path is correct and try again. " | nodejs npm angular
• ng serve Error "File ng.ps1 cannot be loaded. The file ng.ps1 is the current system. " | nodejs npm angular
• Error "Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js)" | nodejs npm angular
Docker for Angular
• Using Docker in a project with Angular (for Windows)
Angular Flex-Layout
• Angular Flex-Layout
WWW Sites to Learn Angular
• Sites to learn Angular

  Ваши вопросы присылайте по почте: info@dir.by