dir.by  
  Search  
Programming, development, testing
Angular
Error "Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js)" | nodejs npm angular
  Looked at 2086 times    
 Error "Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js)" 
last updated: 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 →
Используем Docker в проекте с Angular (под Windows)
 
Your feedback ... Comments ...
   
Your Name
Your comment (www links can only be added by a logged-in user)

  Объявления  
  Объявления  
 
Что такое Angular 8?
Новое приложение Angular 8
Вариант 1. Создаем новое Angular приложение с консоли командой angular/cli (50 файлов)
Создаем новое web приложение с Angular 8. Используем командную строку: npx -p @angular/cli@8.1.0 ng new
Вариант 2 (для меня лучший). Создаем новое Angular приложение сами (8 файлов)
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)
Что происходит при запуске Angular 8 приложения? Запуск main.ts файла. Создание модуля.
Angular 9
Создаем новое web приложение с Angular 9 в Visual Studio Code. Используем: Node.js + Angular (пишем нашу компоненту в ts файле) + Typescript (конвертация файлов ts в js)
Angular 12
Создаем новое web приложение с Angular 12 в Visual Studio Code. Используем: Node.js + Angular (пишем нашу компоненту в ts файле) + Typescript (конвертация файлов ts в js)
В web приложение с Angular 12 добавляем маршрутизацию (router)
Описание Angular
Модули в Angular
Компоненты в Angular
Привязка данных в 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 для Angular
Используем Docker в проекте с Angular (под Windows)
Angular Flex-Layout
Angular Flex-Layout
WWW сайты для изучения Angular
Сайты для изучения Angular

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