angular-webpack-starter: AOT scripts failing

I can’t get the AOT scripts to run

build:aot gives this error

ERROR in ./src/main.browser.aot.ts
Module not found: Error: Can't resolve './compiled/app/app.module.ngfactory' in 'C:\Source\POC\Microservice.Poc\angular2webpack2-starter\src'
 @ ./src/main.browser.aot.ts 6:29-75

ERROR in [default] C:\Source\POC\Microservice.Poc\angular2webpack2-starter\src\main.browser.aot.ts:6:35 
Cannot find module './compiled/app/app.module.ngfactory'.
Child html-webpack-plugin for "index.html":
        + 4 hidden modules

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\dev\\nodejs\\node.exe" "C:\\dev\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run-script" "build:aot"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! angular2webpack2-starter@0.1.0 build:aot: `webpack`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the angular2webpack2-starter@0.1.0 build:aot script 'webpack'.
npm ERR! This is most likely a problem with the angular2webpack2-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular2webpack2-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls angular2webpack2-starter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Source\POC\Microservice.Poc\angular2webpack2-starter\npm-debug.log

Process finished with exit code 1

watch:aot provides this error

"C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.2\bin\runnerw.exe" C:\dev\nodejs\node.exe C:\dev\nodejs\node_modules\npm\bin\npm-cli.js run-script watch:aot

> angular2webpack2-starter@0.1.0 watch:aot C:\Source\POC\Microservice.Poc\angular2webpack2-starter
> npm run compile:watch -- --watch & npm run sass:watch


> angular2webpack2-starter@0.1.0 compile:watch C:\Source\POC\Microservice.Poc\angular2webpack2-starter
> watch-run -i npm run compile:only -p 'src/app/**/*.ts, src/app/**/*.scss' npm run compile:only "--watch"

C:\Source\POC\Microservice.Poc\angular2webpack2-starter\node_modules\watch-run\node_modules\glob\glob.js:119
    throw new Error("must provide pattern")
    ^

Error: must provide pattern
    at new Glob (C:\Source\POC\Microservice.Poc\angular2webpack2-starter\node_modules\watch-run\node_modules\glob\glob.js:119:11)
    at glob (C:\Source\POC\Microservice.Poc\angular2webpack2-starter\node_modules\watch-run\node_modules\glob\glob.js:57:11)
    at Function.globSync [as sync] (C:\Source\POC\Microservice.Poc\angular2webpack2-starter\node_modules\watch-run\node_modules\glob\glob.js:76:10)
    at C:\Source\POC\Microservice.Poc\angular2webpack2-starter\node_modules\watch-run\node_modules\globule\lib\globule.js:77:17
    at C:\Source\POC\Microservice.Poc\angular2webpack2-starter\node_modules\watch-run\node_modules\globule\lib\globule.js:32:30
    at Array.reduce (native)
    at processPatterns (C:\Source\POC\Microservice.Poc\angular2webpack2-starter\node_modules\watch-run\node_modules\globule\lib\globule.js:24:30)
    at Object.globule.find (C:\Source\POC\Microservice.Poc\angular2webpack2-starter\node_modules\watch-run\node_modules\globule\lib\globule.js:76:17)
    at Gaze.add (C:\Source\POC\Microservice.Poc\angular2webpack2-starter\node_modules\watch-run\node_modules\gaze\lib\gaze.js:164:19)
    at new Gaze (C:\Source\POC\Microservice.Poc\angular2webpack2-starter\node_modules\watch-run\node_modules\gaze\lib\gaze.js:68:10)

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\dev\\nodejs\\node.exe" "C:\\Users\\nparson\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "compile:watch" "--" "--watch"
npm ERR! node v4.4.7
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! angular2webpack2-starter@0.1.0 compile:watch: `watch-run -i npm run compile:only -p 'src/app/**/*.ts, src/app/**/*.scss' npm run compile:only "--watch"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the angular2webpack2-starter@0.1.0 compile:watch script 'watch-run -i npm run compile:only -p 'src/app/**/*.ts, src/app/**/*.scss' npm run compile:only "--watch"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2webpack2-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     watch-run -i npm run compile:only -p 'src/app/**/*.ts, src/app/**/*.scss' npm run compile:only "--watch"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular2webpack2-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular2webpack2-starter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Source\POC\Microservice.Poc\angular2webpack2-starter\npm-debug.log

> angular2webpack2-starter@0.1.0 sass:watch C:\Source\POC\Microservice.Poc\angular2webpack2-starter
> node-sass -w src -o src

compile:aot gives this error:

"C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.2\bin\runnerw.exe" C:\dev\nodejs\node.exe C:\dev\nodejs\node_modules\npm\bin\npm-cli.js run-script compile:aot

> angular2webpack2-starter@0.1.0 compile:aot C:\Source\POC\Microservice.Poc\angular2webpack2-starter
> npm run sass && npm run clean:compile && ./node_modules/.bin/ngc -p src && npm run build:aot


> angular2webpack2-starter@0.1.0 sass C:\Source\POC\Microservice.Poc\angular2webpack2-starter
> node-sass src -o src

Rendering Complete, saving .css file...
Wrote CSS to C:\Source\POC\Microservice.Poc\angular2webpack2-starter\src\app\app.css
Wrote 1 CSS files to C:\Source\POC\Microservice.Poc\angular2webpack2-starter\src

> angular2webpack2-starter@0.1.0 clean:compile C:\Source\POC\Microservice.Poc\angular2webpack2-starter
> npm run rimraf -- output compiled src/compiled


> angular2webpack2-starter@0.1.0 rimraf C:\Source\POC\Microservice.Poc\angular2webpack2-starter
> rimraf "output" "compiled" "src/compiled"

'.' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\dev\\nodejs\\node.exe" "C:\\dev\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run-script" "compile:aot"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! angular2webpack2-starter@0.1.0 compile:aot: `npm run sass && npm run clean:compile && ./node_modules/.bin/ngc -p src && npm run build:aot`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the angular2webpack2-starter@0.1.0 compile:aot script 'npm run sass && npm run clean:compile && ./node_modules/.bin/ngc -p src && npm run build:aot'.
npm ERR! This is most likely a problem with the angular2webpack2-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run sass && npm run clean:compile && ./node_modules/.bin/ngc -p src && npm run build:aot
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular2webpack2-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls angular2webpack2-starter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Source\POC\Microservice.Poc\angular2webpack2-starter\npm-debug.log

Process finished with exit code 1

I did npm install before hand. Windows 10 env

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 31 (16 by maintainers)

Most upvoted comments

@Meligy I just removed comment from json and updated readme.

npm run build will create a JIT version of your project. npm run compile will create an AOT version of your project. AOT is smaller on a small app, but can be bigger on a big app, depends on your templates and lazy loading. AOT apps should always be faster than JIT apps, they compile about twice as fast in the browser.