New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gulp build fails and cc.ENGINE_VERSION inconsistencies #2243

Closed
sommerper opened this Issue Jan 8, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@sommerper

sommerper commented Jan 8, 2018

I have downloaded the 1.8 release of Cocos Creator for MacOS.
I need to do some changes in the engine code but gulp build fails

cd /Applications/CocosCreator.app/Contents/Resources/engine
npm install
gulp build

Gives me an error

/A/C/C/R/engine ❯❯❯ gulp build
[14:58:47] Using gulpfile /Applications/CocosCreator.app/Contents/Resources/engine/gulpfile.js
[14:58:47] Starting 'build-html5-preview'...
[14:58:47] Starting 'build-jsb-preview'...
[14:58:47] Starting 'build-jsb-dev'...
[14:58:47] Starting 'build-jsb-min'...
[14:59:57] [ERROR] { GulpUglifyError: unable to minify JavaScript
    at createError (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/lib/create-error.js:6:14)
    at apply (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/lodash/_apply.js:16:25)
    at wrapper (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/lodash/_createCurry.js:41:12)
    at /Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/lib/minify.js:54:15
    at DestroyableTransform._transform (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/composer.js:10:23)
    at DestroyableTransform.Transform._read (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_transform.js:182:10)
    at DestroyableTransform.Transform._write (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_transform.js:170:83)
    at doWrite (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:406:64)
    at writeOrBuffer (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:395:5)
    at DestroyableTransform.Writable.write (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:322:11)
  cause:
   { DefaultsError: `cascade` is not a supported option
    at DefaultsError.get (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:75:23)
    at formatError (util.js:642:16)
    at formatValue (util.js:544:18)
    at formatProperty (util.js:833:11)
    at formatObject (util.js:649:17)
    at formatValue (util.js:609:18)
    at inspect (util.js:324:10)
    at format (util.js:253:18)
    at Console.log (console.js:130:21)
    at Object.module.exports [as log] (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-util/lib/log.js:7:15)
     message: '`cascade` is not a supported option',
     defs:
      { arrows: true,
        booleans: true,
        collapse_vars: true,
        comparisons: true,
        computed_props: true,
        conditionals: true,
        dead_code: true,
        drop_console: false,
        drop_debugger: true,
        ecma: 5,
        evaluate: true,
        expression: false,
        global_defs: {},
        hoist_funs: false,
        hoist_props: true,
        hoist_vars: false,
        ie8: false,
        if_return: true,
        inline: true,
        join_vars: true,
        keep_classnames: false,
        keep_fargs: true,
        keep_fnames: false,
        keep_infinity: false,
        loops: true,
        negate_iife: true,
        passes: 1,
        properties: true,
        pure_getters: 'strict',
        pure_funcs: null,
        reduce_funcs: true,
        reduce_vars: true,
        sequences: true,
        side_effects: true,
        switches: true,
        top_retain: null,
        toplevel: false,
        typeofs: true,
        unsafe: false,
        unsafe_arrows: false,
        unsafe_comps: false,
        unsafe_Func: false,
        unsafe_math: false,
        unsafe_methods: false,
        unsafe_proto: false,
        unsafe_regexp: false,
        unused: true,
        warnings: false } },
  plugin: 'gulp-uglify',
  fileName: '/Applications/CocosCreator.app/Contents/Resources/engine/cocos2d-js-for-preview.js',
  showStack: false }
[14:59:57] [ERROR] GulpUglifyError: unable to minify JavaScript
    at createError (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/lib/create-error.js:6:14)
    at apply (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/lodash/_apply.js:16:25)
    at wrapper (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/lodash/_createCurry.js:41:12)
    at /Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/lib/minify.js:54:15
    at DestroyableTransform._transform (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/composer.js:10:23)
    at DestroyableTransform.Transform._read (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_transform.js:182:10)
    at DestroyableTransform.Transform._write (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_transform.js:170:83)
    at doWrite (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:406:64)
    at writeOrBuffer (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:395:5)
    at DestroyableTransform.Writable.write (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:322:11)
[14:59:57] Finished 'build-html5-preview' after 1.17 min
[15:00:00] [ERROR] { GulpUglifyError: unable to minify JavaScript
    at createError (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/lib/create-error.js:6:14)
    at apply (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/lodash/_apply.js:16:25)
    at wrapper (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/lodash/_createCurry.js:41:12)
    at /Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/lib/minify.js:54:15
    at DestroyableTransform._transform (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/composer.js:10:23)
    at DestroyableTransform.Transform._read (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_transform.js:182:10)
    at DestroyableTransform.Transform._write (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_transform.js:170:83)
    at doWrite (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:406:64)
    at writeOrBuffer (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:395:5)
    at DestroyableTransform.Writable.write (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:322:11)
  cause:
   { DefaultsError: `cascade` is not a supported option
    at DefaultsError.get (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:75:23)
    at formatError (util.js:642:16)
    at formatValue (util.js:544:18)
    at formatProperty (util.js:833:11)
    at formatObject (util.js:649:17)
    at formatValue (util.js:609:18)
    at inspect (util.js:324:10)
    at format (util.js:253:18)
    at Console.log (console.js:130:21)
    at Object.module.exports [as log] (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-util/lib/log.js:7:15)
     message: '`cascade` is not a supported option',
     defs:
      { arrows: true,
        booleans: true,
        collapse_vars: true,
        comparisons: true,
        computed_props: true,
        conditionals: true,
        dead_code: true,
        drop_console: false,
        drop_debugger: true,
        ecma: 5,
        evaluate: true,
        expression: false,
        global_defs: {},
        hoist_funs: false,
        hoist_props: true,
        hoist_vars: false,
        ie8: false,
        if_return: true,
        inline: true,
        join_vars: true,
        keep_classnames: false,
        keep_fargs: true,
        keep_fnames: false,
        keep_infinity: false,
        loops: true,
        negate_iife: true,
        passes: 1,
        properties: true,
        pure_getters: 'strict',
        pure_funcs: null,
        reduce_funcs: true,
        reduce_vars: true,
        sequences: true,
        side_effects: true,
        switches: true,
        top_retain: null,
        toplevel: false,
        typeofs: true,
        unsafe: false,
        unsafe_arrows: false,
        unsafe_comps: false,
        unsafe_Func: false,
        unsafe_math: false,
        unsafe_methods: false,
        unsafe_proto: false,
        unsafe_regexp: false,
        unused: true,
        warnings: false } },
  plugin: 'gulp-uglify',
  fileName: '/Applications/CocosCreator.app/Contents/Resources/engine/jsb_polyfill-for-preview.js',
  showStack: false }
[15:00:00] [ERROR] GulpUglifyError: unable to minify JavaScript
    at createError (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/lib/create-error.js:6:14)
    at apply (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/lodash/_apply.js:16:25)
    at wrapper (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/lodash/_createCurry.js:41:12)
    at /Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/lib/minify.js:54:15
    at DestroyableTransform._transform (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/composer.js:10:23)
    at DestroyableTransform.Transform._read (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_transform.js:182:10)
    at DestroyableTransform.Transform._write (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_transform.js:170:83)
    at doWrite (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:406:64)
    at writeOrBuffer (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:395:5)
    at DestroyableTransform.Writable.write (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:322:11)
[15:00:00] Finished 'build-jsb-preview' after 1.22 min
[15:00:05] [ERROR] { GulpUglifyError: unable to minify JavaScript
    at createError (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/lib/create-error.js:6:14)
    at apply (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/lodash/_apply.js:16:25)
    at wrapper (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/lodash/_createCurry.js:41:12)
    at /Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/lib/minify.js:54:15
    at DestroyableTransform._transform (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/composer.js:10:23)
    at DestroyableTransform.Transform._read (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_transform.js:182:10)
    at DestroyableTransform.Transform._write (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_transform.js:170:83)
    at doWrite (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:406:64)
    at writeOrBuffer (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:395:5)
    at DestroyableTransform.Writable.write (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:322:11)
  cause:
   { DefaultsError: `cascade` is not a supported option
    at DefaultsError.get (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:75:23)
    at formatError (util.js:642:16)
    at formatValue (util.js:544:18)
    at formatProperty (util.js:833:11)
    at formatObject (util.js:649:17)
    at formatValue (util.js:609:18)
    at inspect (util.js:324:10)
    at format (util.js:253:18)
    at Console.log (console.js:130:21)
    at Object.module.exports [as log] (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-util/lib/log.js:7:15)
     message: '`cascade` is not a supported option',
     defs:
      { arrows: true,
        booleans: true,
        collapse_vars: true,
        comparisons: true,
        computed_props: true,
        conditionals: true,
        dead_code: true,
        drop_console: false,
        drop_debugger: true,
        ecma: 5,
        evaluate: true,
        expression: false,
        global_defs: {},
        hoist_funs: false,
        hoist_props: true,
        hoist_vars: false,
        ie8: false,
        if_return: true,
        inline: true,
        join_vars: true,
        keep_classnames: false,
        keep_fargs: true,
        keep_fnames: false,
        keep_infinity: false,
        loops: true,
        negate_iife: true,
        passes: 1,
        properties: true,
        pure_getters: 'strict',
        pure_funcs: null,
        reduce_funcs: true,
        reduce_vars: true,
        sequences: true,
        side_effects: true,
        switches: true,
        top_retain: null,
        toplevel: false,
        typeofs: true,
        unsafe: false,
        unsafe_arrows: false,
        unsafe_comps: false,
        unsafe_Func: false,
        unsafe_math: false,
        unsafe_methods: false,
        unsafe_proto: false,
        unsafe_regexp: false,
        unused: true,
        warnings: false } },
  plugin: 'gulp-uglify',
  fileName: '/Applications/CocosCreator.app/Contents/Resources/engine/jsb_polyfill.dev.js',
  showStack: false }
[15:00:05] [ERROR] GulpUglifyError: unable to minify JavaScript
    at createError (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/lib/create-error.js:6:14)
    at apply (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/lodash/_apply.js:16:25)
    at wrapper (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/lodash/_createCurry.js:41:12)
    at /Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/lib/minify.js:54:15
    at DestroyableTransform._transform (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/gulp-uglify/composer.js:10:23)
    at DestroyableTransform.Transform._read (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_transform.js:182:10)
    at DestroyableTransform.Transform._write (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_transform.js:170:83)
    at doWrite (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:406:64)
    at writeOrBuffer (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:395:5)
    at DestroyableTransform.Writable.write (/Applications/CocosCreator.app/Contents/Resources/engine/node_modules/readable-stream/lib/_stream_writable.js:322:11)
[15:00:05] Finished 'build-jsb-dev' after 1.28 min
[15:00:22] Finished 'build-jsb-min' after 1.58 min
[15:00:22] Starting 'build-jsb'...
[15:00:22] Finished 'build-jsb' after 51 μs
[15:00:22] Starting 'build'...
[15:00:22] Finished 'build' after 13 ms

So I clone the https://github.com/cocos-creator/engine/ repository and switch to the v1.8-release branch.

No problems with gulp build so I copy the bin folder to /Applications/CocosCreator.app/Contents/Resources/engine/bin

Now I see that Chrome logs out engine version is 1.6.0, not 1.8.0 as it should be.

https://github.com/cocos-creator/engine/blob/v1.8/CCBoot.js says the engine version is 1.6.0
/Applications/CocosCreator.app/Contents/Resources/engine/CCBoot.js says the engine version is 1.8.0

Shouldn't those two files be the same?
Can I count on this repository being identical to what is delivered with the editor?
How can I make changes to the engine and be sure that use the version that matches the editor?

Thanks in advance!

@jareguo

This comment has been minimized.

Show comment
Hide comment
@jareguo

jareguo Jan 8, 2018

Contributor

The engine version is not correct in CCBoot, but it doesn't matter.
The gulp error is just because you need to npm update uglify-es to latest version.

Contributor

jareguo commented Jan 8, 2018

The engine version is not correct in CCBoot, but it doesn't matter.
The gulp error is just because you need to npm update uglify-es to latest version.

@jareguo jareguo closed this Jan 8, 2018

@sommerper

This comment has been minimized.

Show comment
Hide comment
@sommerper

sommerper Jan 8, 2018

I did this in the engine folder

npm uninstall uglify-es
npm install uglify-es

uglify-es is now at
"uglify-es": "^3.3.5"

When I run gulp build I still get the same error.

sommerper commented Jan 8, 2018

I did this in the engine folder

npm uninstall uglify-es
npm install uglify-es

uglify-es is now at
"uglify-es": "^3.3.5"

When I run gulp build I still get the same error.

@jareguo

This comment has been minimized.

Show comment
Hide comment
@jareguo

jareguo Jan 8, 2018

Contributor

Sorry, the bug not yet being fixed in the builtin 1.8.0. Please checkout the v1.8-release branch from git and retry.

Contributor

jareguo commented Jan 8, 2018

Sorry, the bug not yet being fixed in the builtin 1.8.0. Please checkout the v1.8-release branch from git and retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment