Repository navigation
npm run build:prod fails with assetsTypeError on fresh install #473
Copy link
Copy link
Closed
Description
- I'm submitting a ...
[:heavy_check_mark:] bug report
[ ] feature request
[ ] question about the decisions made in the repository
Just cloned the repo and installed dependencies etc. and was able to run it with npm start and view the page in my browser. However, when I run npm run build:prod it fails. Output:
$ npm run build:prod
> angular2-webpack-starter@4.0.0 prebuild:prod /Users/gob/tmp/angular2-webpack-starter
> npm run clean:dist
> angular2-webpack-starter@4.0.0 clean:dist /Users/gob/tmp/angular2-webpack-starter
> rimraf dist
> angular2-webpack-starter@4.0.0 build:prod /Users/gob/tmp/angular2-webpack-starter
> node --max-old-space-size=4096 ./node_modules/webpack/bin/webpack --config config/webpack.prod.js --progress --profile --colors --display-error-details --display-cached --bail
root directory: /Users/gob/tmp/angular2-webpack-starter
14957ms build modules
21ms seal
176ms optimize
587ms hashing
121ms create chunk assets
21589ms additional chunk assets
80% optimize chunk assetsTypeError: callback is not a function
at Gzip.onEnd (zlib.js:227:5)
at emitNone (events.js:72:20)
at Gzip.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:903:12)
at doNTCallback2 (node.js:439:9)
at process._tickCallback (node.js:353:17)
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build:prod"
npm ERR! node v4.2.1
npm ERR! npm v2.10.0
npm ERR! code ELIFECYCLE
npm ERR! angular2-webpack-starter@4.0.0 build:prod: `node --max-old-space-size=4096 ./node_modules/webpack/bin/webpack --config config/webpack.prod.js --progress --profile --colors --display-error-details --display-cached --bail`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-webpack-starter@4.0.0 build:prod script 'node --max-old-space-size=4096 ./node_modules/webpack/bin/webpack --config config/webpack.prod.js --progress --profile --colors --display-error-details --display-cached --bail'.
npm ERR! This is most likely a problem with the angular2-webpack-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node --max-old-space-size=4096 ./node_modules/webpack/bin/webpack --config config/webpack.prod.js --progress --profile --colors --display-error-details --display-cached --bail
npm ERR! You can get their info via:
npm ERR! npm owner ls angular2-webpack-starter
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/gob/tmp/angular2-webpack-starter/npm-debug.log
The contents of npm-debug.log (redundant bits excluded):
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build:prod' ]
2 info using npm@2.10.0
3 info using node@v4.2.1
4 verbose run-script [ 'prebuild:prod', 'build:prod', 'postbuild:prod' ]
5 info prebuild:prod angular2-webpack-starter@4.0.0
6 verbose unsafe-perm in lifecycle true
7 info build:prod angular2-webpack-starter@4.0.0
8 verbose unsafe-perm in lifecycle true
9 info angular2-webpack-starter@4.0.0 Failed to exec build:prod script
10 verbose stack Error: angular2-webpack-starter@4.0.0 build:prod: `node --max-old-space-size=4096 ./node_modules/webpack/bin/webpack --config config/webpack.prod.js --progress --profile --colors --display-error-details --display-cached --bail`
10 verbose stack Exit status 1
10 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
10 verbose stack at emitTwo (events.js:87:13)
10 verbose stack at EventEmitter.emit (events.js:172:7)
10 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
10 verbose stack at emitTwo (events.js:87:13)
10 verbose stack at ChildProcess.emit (events.js:172:7)
10 verbose stack at maybeClose (internal/child_process.js:818:16)
10 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
11 verbose pkgid angular2-webpack-starter@4.0.0
12 verbose cwd /Users/gob/tmp/angular2-webpack-starter
[...]
20 verbose exit [ 1, true ]
No idea even where to begin debugging myself. I'm on OS X 10.11.1, node v4.2.1, just cloned repo today (Mar 27).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
aegyed91 commentedon Mar 27, 2016
have the very same problem here
mbalex99 commentedon Mar 28, 2016
When I commented out the Compression plugin, it worked...
In
webpack.prod.jsconfig file, I commented outleonardoanalista commentedon Mar 28, 2016
I have the same problem I am using npm 3 with node 4.4.1. It works with block above commented out. Thanks for sharing.
antonycooper commentedon Mar 28, 2016
The problem is with the "algorithm: helpers.gzipMaxLevel,".
I haven't exploed the problem in depth, but "algorithm: 'gzip'" and it works for me.
aegyed91 commentedon Mar 28, 2016
@antonycooper i investigated it, our helper isn't necessary anymore and
algorithm: 'gzip'is what we need.. what is the default option so we can delete this line and the helper.check this line you can specify the compression level in
optionsand it defaults to 9.antonycooper commentedon Mar 28, 2016
@tsm91 I just went to https://github.com/webpack/compression-webpack-plugin and used the default options from there.
aegyed91 commentedon Mar 28, 2016
@antonycooper yep, that's perfect
Spittal commentedon Mar 28, 2016
I can confirm switching algorithm to 'gzip' works.
PatrickJS commentedon Mar 28, 2016
can someone create a PR?
Merge pull request #476 from adarshaj/fix/update-compression-options