eclipse / iottestware

Eclipse Public License 1.0
10 stars 12 forks source link

docker build command fails #24

Closed srak2016 closed 1 year ago

srak2016 commented 1 year ago

In Ubuntu 18.04, docker build command failed due to npm compatibility issue. Same error occurs with Ubuntu 22.04 as well, kindly let me know the fix.

I issue the following commands.

TESTWARE=iot_testware git clone https://github.com/eclipse/iottestware.dashboard cd iottestware.dashboard sudo docker build -t $TESTWARE .

The error I get is,

ERROR: npm v9.3.0 is known not to run on Node.js v8.17.0. You'll need to upgrade to a newer Node.js version in order to use this version of npm. This version of npm supports the following node versions: ^14.17.0 || ^16.13.0 || >=18.0.0. You can find the latest version at https://nodejs.org/.

ERROR: /usr/lib/node_modules/npm/lib/utils/exit-handler.js:21 const hasLoadedNpm = npm?.config.loaded ^

SyntaxError: Unexpected token . at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:617:28) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at module.exports (/usr/lib/node_modules/npm/lib/cli.js:81:23) The command '/bin/sh -c rm -rf node_modules && npm install' returned a non-zero code: 1

Thanks for any help!

srak2016 commented 1 year ago

Build pass though after drop npm update as mentioned in https://github.com/eclipse/iottestware/issues/22

RUN npm i -g npm

alexanderkaiser commented 1 year ago

Hi @srak2016 I'm glad you found the solution. I have merged the PR provided in #22 and would be very grateful if you could recheck the fix from @seriousme directly from master.

srak2016 commented 1 year ago

@alexanderkaiser I verified the build again, now it is successful without making any corrections.

alexanderkaiser commented 1 year ago

@srak2016 thank you