question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

when i run npm run electron:windows or npm run build:prod it shows an error and it says that angular 5+ needs cli 1.5 ++ and i have both of them globaly and in the repo please fix it as soon as possible

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
maximegriscommented, Nov 18, 2017

I fixed the issue. You can pull the repo (master branch or 2.1.0 tag); Please follow those steps if you want to fix this mannually, :

1/ In webpack.config.js, replace AotPlugin to AngularCompilerPlugin

  • line 13
const { AngularCompilerPlugin } = require('@ngtools/webpack');
  • line 168:
    plugins.push(new AngularCompilerPlugin({
      entryModule: "src/app/app.module#AppModule",
      "mainPath": "main.ts",
      "hostReplacementPaths": {
        "environments/index.ts": "environments/index.prod.ts"
      },
      "exclude": [],
      "tsConfigPath": "src/tsconfig.app.json"
    }));

line 189

    plugins.push(new AngularCompilerPlugin({
      entryModule: "src/app/app.module#AppModule",
      "mainPath": "main.ts",
      "hostReplacementPaths": {
        "environments/index.ts": "environments/index.ts"
      },
      "exclude": [],
      "tsConfigPath": "src/tsconfig.app.json"
    }));

2/ In tsconfig.ts , replace value of AllowJs from true to false. There is an issue in aot compilation with Angular 5 (https://github.com/angular/angular/issues/19757)

It should fix the problem.

1reaction
Kamar-Meddahcommented, Nov 15, 2017

ERROR in ./src/main.ts Module not found: Error: Can’t resolve ‘./$$_gendir/app/app.module.ngfactory’ in ‘C:\Users\User\Documents\MyApps\angular\src’ resolve ‘./$$_gendir/app/app.module.ngfactory’ in ‘C:\Users\User\Documents\MyApp s\angular\src’ using description file: C:\Users\User\Documents\MyApps\angular\package.json (r elative path: ./src) after using description file: C:\Users\User\Documents\MyApps\angular\package.j son (relative path: ./src) using description file: C:\Users\User\Documents\MyApps\angular\package.json (relative path: ./src/$$_gendir/app/app.module.ngfactory) no extension C:\Users\User\Documents\MyApps\angular\src$$_gendir\app\app.module.ngfa ctory doesn’t exist .ts C:\Users\User\Documents\MyApps\angular\src$$_gendir\app\app.module.ngfa ctory.ts doesn’t exist .js C:\Users\User\Documents\MyApps\angular\src$$_gendir\app\app.module.ngfa ctory.js doesn’t exist .scss C:\Users\User\Documents\MyApps\angular\src$$_gendir\app\app.module.ngfa ctory.scss doesn’t exist .json C:\Users\User\Documents\MyApps\angular\src$$_gendir\app\app.module.ngfa ctory.json doesn’t exist as directory C:\Users\User\Documents\MyApps\angular\src$$_gendir\app\app.module.ngfa ctory doesn’t exist [C:\Users\User\Documents\MyApps\angular\src$$_gendir\app\app.module.ngfactory] [C:\Users\User\Documents\MyApps\angular\src$$_gendir\app\app.module.ngfactory.t s] [C:\Users\User\Documents\MyApps\angular\src$$_gendir\app\app.module.ngfactory.j s] [C:\Users\User\Documents\MyApps\angular\src$$_gendir\app\app.module.ngfactory.s css] [C:\Users\User\Documents\MyApps\angular\src$$_gendir\app\app.module.ngfactory.j son] [C:\Users\User\Documents\MyApps\angular\src$$_gendir\app\app.module.ngfactory] @ ./src/main.ts 3:0-74 @ multi ./src/main.ts

ERROR in Error: Please update @angular/cli. Angular 5+ requires at least Angular CLI 1.5+ at throwNotSupportedError (C:\Users\User\Documents\MyApps\angular\node_modul es@angular\compiler-cli\src\ngtools_api.js:78:11) at Function.NgTools_InternalApi_NG_2.codeGen (C:\Users\User\Documents\MyApps \angular\node_modules@angular\compiler-cli\src\ngtools_api.js:31:15) at _donePromise.Promise.resolve.then (C:\Users\User\Documents\MyApps\angular \node_modules@ngtools\webpack\src\plugin.js:430:58) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) at Function.Module.runMain (module.js:684:11) at startup (bootstrap_node.js:191:16) at bootstrap_node.js:613:3 Child html-webpack-plugin for “index.html”: 1 asset [7GO9] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html 377 bytes {0} [built] npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! angular-electron@2.0.0 build: webpack --display-error-details && npm r un build:electron:main npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the angular-electron@2.0.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\User\AppData\Roaming\npm-cache_logs\2017-11-15T20_38_16_6 31Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! angular-electron@2.0.0 build:prod: cross-env NODE_ENV=production npm r un build npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the angular-electron@2.0.0 build:prod script. npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\User\AppData\Roaming\npm-cache_logs\2017-11-15T20_38_16_7 25Z-debug.log

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix a build error
Fix a build error · Right-click anywhere in the Error List window. · Select Copy List. · Open Microsoft Excel or Word (or...
Read more >
Project build errors and warnings (PRJxxxx) - Microsoft Learn
The Visual Studio compilers and build tools can report many kinds of errors and warnings. After an error or warning is found, the...
Read more >
Oh dear! Build errors? - LoopDocs - GitHub Pages
This page contains build error help for people updating their Loop app as well as brand new Loop app builders. Review the "obvious"...
Read more >
"Error building project: The build hook failed with status code 1".
In the deployment error log, the error message ends with: "Error building project: The build hook failed with status code 1. Aborted build"....
Read more >
I am getting this error that " building has encountered an error ...
I simplied started a new project to learn about graphics and a class. immediately I clicked on ok, there was immediately a popup...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found