hobbit-project / platform

HOBBIT benchmarking platform
GNU General Public License v2.0
24 stars 9 forks source link

GUI build error #187

Closed smirnp closed 6 years ago

smirnp commented 6 years ago

I'm trying to build the GUI for the 1.0.14 and get the error. 'npm build' not not helping like it helped before (#142)

~/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client$ sudo npm run build prod

> hobbit-gui@2.0.0 build /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client
> ng build "prod"

Hash: c110368a9cde22aef61c
Time: 44322ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 194 kB {5} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 148 kB {4} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 214 kB {5} [initial] [rendered]
chunk    {3} scripts.bundle.js, scripts.bundle.js.map (scripts) 448 kB {5} [initial] [rendered]
chunk    {4} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.59 MB [initial] [rendered]
chunk    {5} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

ERROR in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader?{"ident":"postcss"}!./~/bootstrap/dist/css/bootstrap.min.css
Module build failed: BrowserslistError: Unknown browser major
    at error (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/browserslist/index.js:37:11)
    at Function.browserslist.checkName (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/browserslist/index.js:320:18)
    at Function.select (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/browserslist/index.js:438:37)
    at /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/browserslist/index.js:207:41
    at Array.forEach (native)
    at browserslist (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/browserslist/index.js:196:13)
    at Browsers.parse (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/autoprefixer/lib/browsers.js:44:14)
    at new Browsers (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/autoprefixer/lib/browsers.js:39:28)
    at loadPrefixes (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/autoprefixer/lib/autoprefixer.js:56:18)
    at plugin (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/autoprefixer/lib/autoprefixer.js:62:18)
    at LazyResult.run (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/postcss/lib/lazy-result.js:274:20)
    at LazyResult.asyncTick (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/postcss/lib/lazy-result.js:189:32)
    at LazyResult.asyncTick (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/postcss/lib/lazy-result.js:201:22)
    at processing.Promise.then._this2.processed (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/postcss/lib/lazy-result.js:228:20)
    at LazyResult.async (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/postcss/lib/lazy-result.js:225:27)
    at LazyResult.then (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/postcss/lib/lazy-result.js:131:21)
 @ ./~/bootstrap/dist/css/bootstrap.min.css 4:14-127
 @ multi ./src/styles.css ./~/bootstrap/dist/css/bootstrap.min.css ./~/font-awesome/css/font-awesome.css ./~/ng2-slim-loading-bar/bundles/style.css ./~/primeng/resources/primeng.min.css ./~/primeng/resources/themes/bootstrap/theme.css
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hobbit-gui@2.0.0 build: `ng build "prod"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hobbit-gui@2.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2018-01-08T09_24_52_858Z-debug.log
Ennosigaeon commented 6 years ago

This problem is described here and caused by the current bootstrap-4v beta (this line). A permanent solution would be to change the configuration to 4.0.0-beta.2 (omit the leading carret) or use this workaround until bootstrap or angular-cli fixes this problem:

npm uninstall bootstrap --save
npm install bootstrap@4.0.0-beta.2 --save
MichaelRoeder commented 6 years ago

@Ennosigaeon would it be helpful to remove the node_modules directory and execute the build process again or will npm always download the old bootstrap version?

Ennosigaeon commented 6 years ago

If you have installed everything before the latest bootstrap release (like 14 days ago or something like that) everything will work as bootstrap@4.0.0-beta.2 satisfies ^4.0.0-beta. However, if no node_modules folder is available (like at a new installation) the latest verison bootstrap@4.0.0-beta.3 will be downloaded and the build fails.

So either we fix the version at beta2 or you manually downgrade to beta2.

MichaelRoeder commented 6 years ago

Got it. Thanks :smiley:

smirnp commented 6 years ago

Downgrade helped, thank you!

I had errors during removal and installation, but both seems to be succeeded:

~/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client$ sudo npm uninstall bootstrap
--save

> node-sass@4.7.2 install /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass
> node scripts/install.js

Unable to save binary /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/vendor/linux-x64-48 : { Error: EACCES: permission denied, mkdir '/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/vendor'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:924:18)
    at sync (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/mkdirp/index.js:77:24)
    at checkAndDownloadBinary (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/scripts/install.js:111:11)
    at Object.<anonymous> (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/scripts/install.js:154:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/vendor' }

> node-sass@4.7.2 postinstall /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass
> node scripts/build.js

Building: /usr/bin/node /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/bin/node',
gyp verb cli   '/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@6.11.5 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.6\n"
gyp verb get node dir no --target version specified, falling back to host node version: 6.11.5
gyp verb command install [ '6.11.5' ]
gyp verb install input version string "6.11.5"
gyp verb install installing version: 6.11.5
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 6.11.5
gyp verb build dir attempting to create "build" dir: /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/build'
gyp ERR! stack     at Error (native)
gyp ERR! System Linux 3.13.0-133-generic
gyp ERR! command "/usr/bin/node" "/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass
gyp ERR! node -v v6.11.5
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN extract-text-webpack-plugin@2.1.2 requires a peer of webpack@^2.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-server@2.4.5 requires a peer of webpack@^2.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 (node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 postinstall: `node scripts/build.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

removed 1 package in 19.623s

Installation:

~/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client$ sudo npm install bootstrap@4.
0.0-beta.2 --save

> node-sass@4.7.2 install /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass
> node scripts/install.js

Unable to save binary /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/vendor/linux-x64-48 : { Error: EACCES: permission denied, mkdir '/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/vendor'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:924:18)
    at sync (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/mkdirp/index.js:77:24)
    at checkAndDownloadBinary (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/scripts/install.js:111:11)
    at Object.<anonymous> (/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/scripts/install.js:154:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/vendor' }

> node-sass@4.7.2 postinstall /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass
> node scripts/build.js

Building: /usr/bin/node /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/bin/node',
gyp verb cli   '/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@6.11.5 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.6\n"
gyp verb get node dir no --target version specified, falling back to host node version: 6.11.5
gyp verb command install [ '6.11.5' ]
gyp verb install input version string "6.11.5"
gyp verb install installing version: 6.11.5
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 6.11.5
gyp verb build dir attempting to create "build" dir: /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass/build'
gyp ERR! stack     at Error (native)
gyp ERR! System Linux 3.13.0-133-generic
gyp ERR! command "/usr/bin/node" "/home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/vagrant/Projects/hobbit-platform_1.0.14/hobbit-gui/gui-client/node_modules/node-sass
gyp ERR! node -v v6.11.5
npm WARN extract-text-webpack-plugin@2.1.2 requires a peer of webpack@^2.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-server@2.4.5 requires a peer of webpack@^2.2.0 but none is installed. You must install peer dependencies yourself.....] \ postinstall: info lifecycle bootstrap@4.0.0-beta.2~postinstall: bootstrap@4.0.0-beta.2
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 (node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 postinstall: `node scripts/build.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ bootstrap@4.0.0-beta.2
added 1 package in 21.318s
smirnp commented 6 years ago

Bootstap downgrade makes not possible to build the older versions of the GUI (1.0.13). How I may return back the original version, which I have uninstalled?

Ennosigaeon commented 6 years ago

I am a little bit confused. GUI@1.0.13 was released on 06.11.2017. Bootstrap@4.0.0-beta.3 was released on 28.12.2017. So it should be no problem to build GUI@1.0.13 since it worked for roughly two months.

To which bootstrap version do you have downgraded? And what was the exact build error?

MichaelRoeder commented 6 years ago

Fallback solution: use the pre-build image by replacing

  # HOBBIT GUI
  gui:
    build: ./hobbit-gui/gui-serverbackend

with

  # HOBBIT GUI
  gui:
    image: git.project-hobbit.eu:4567/gitadmin/platform-gui-image:1.0.13

in your docker-compose file. Just my two cents :wink:

smirnp commented 6 years ago

Prebuild image works fine. Thank you!