Installation problem during "php bakery build-assets -c"


#1

I get the following error in a ubuntu server when running php bakery build-assets -c at the end of the installation:

Building assets for production

npm run uf-bundle-build

@userfrosting/[email protected] uf-bundle-build /var/www/miltondox/build
gulp bundle-build

[02:30:46] Using gulpfile /var/www/miltondox/build/gulpfile.js
[02:30:46] Starting ‘bundle-build’…
[02:30:48] Finished ‘bundle-build’ after 2.28 s

npm run uf-bundle

@userfrosting/[email protected] uf-bundle /var/www/miltondox/build
gulp bundle
[02:21:12] Using gulpfile /var/www/miltondox/build/gulpfile.js
[02:21:12] Starting ‘bundle’…
[02:21:12] ‘bundle’ errored after 307 ms
[02:21:12] ReferenceError: Invalid left-hand side in assignment
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions…js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/var/www/miltondox/build/node_modules/gulp-uf-bundle-assets/lib/stream-files.js:12:11)
at Module._compile (module.js:410:26)
at Object.Module._extensions…js (module.js:417:10)

npm ERR! Linux 4.4.0-134-generic
npm ERR! argv “/usr/bin/nodejs” “/usr/bin/npm” “run” “uf-bundle” “–prefix” “/var/www/miltondox/build”
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! @userfrosting/[email protected] uf-bundle: gulp bundle
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @userfrosting/[email protected] uf-bundle script ‘gulp bundle’.
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 @userfrosting/userfrosting package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! gulp bundle
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs @userfrosting/userfrosting
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls @userfrosting/userfrosting
npm ERR! There is likely additional logging output above.

I tried to access the http version of the site to check if it might be available in spite of the errors, but currently nothing is showing up. What could be wrong?

Edit: I changed the .env from production to default, ran a npm install from the build directory, then a php bakery bake without the -c and I can now access the site, but the php bakery bake -c continues to fail with the same error.


#2

The -c switch tells the tooling to generate compiled (i.e. bundle files together and minify). Running under production mode does the same thing.

Irritatingly gulp-bundle-uf-assets is the error source, and its currently in an unworkable state (I’m almost done with a major rewrite, but its a breaking change which will come along with UF4.2 is everything goes to plan).

Something worth trying would be updating Node. Its possible something is using a newer feature (since the line its complaining about is literally just importing another library.


#3

Edit: Updating node did the trick. Everything is working now. Thanks!


#4

That was wayyyy out of date btw. Current stable version of node is 10.