openscopeproject / TrguiNG

Remote GUI for Transmission torrent daemon
GNU Affero General Public License v3.0
265 stars 32 forks source link

webpack hits syntax error when building (ubuntu 22.04) #161

Closed Will-Hendrix closed 4 months ago

Will-Hendrix commented 5 months ago

the npm run build fails out when running the first command:

$ npm run build                                                                                                                                                                                                                                                                                            

> trguing@1.1.0 build
> tauri build 

     Running beforeBuildCommand `npm run webpack-prod`

> trguing@1.1.0 webpack-prod
> webpack --config webpack.prod.js

[webpack-cli] Failed to load '/home/me/projects/inst/trguing/TrguiNG/webpack.prod.js' config 
[webpack-cli] SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
       Error beforeBuildCommand `npm run webpack-prod` failed with exit code 2  

the file webpack.prod.js is there, but not nearly big enough to reach a line 133. I'm relatively new to linux so I may just be doing something dumb, but I can't figure out what it is.

qu1ck commented 5 months ago

That is not first command, you should run npm install or better npm ci first.

qu1ck commented 5 months ago

On second look, that looks like you have old nodejs that comes from ubuntu repos. You need at least v16. 18 or 20 should work too.

Some good info here. https://www.reddit.com/r/laravel/comments/xqtcgz/ubuntu_and_node_getting_syntaxerror_unexpected/