apiconnect-docker
apiconnect-docker copied to clipboard
error in step 5
/usr/local/lib/node_modules/npm/bin/npm-cli.js:79 let notifier = require('update-notifier')({pkg}) ^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:373:25) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module.runMain (module.js:441:10) at startup (node.js:140:18) at node.js:1043:3 ERROR: Service 'microservice' failed to build: The command '/bin/sh -c npm install --silent -g npm && npm install --silent --prod && npm prune --prod' returned a non-zero code: 1
I've fixed this one by updating microservice/Dockerfile from node:4-slim to node:6-slim.
I can't confirm that there are no issues in the microservice container, though, but docker-compose up -d completed and I can see gateway, portal, etc.
Thanks, Gleidson
Hi Slaterx,
I changed the dockerfile as you suggested. It downloaded the image node6-slim. However, I am now seeing the below error when it it executing Step 5 -
Error: Cannot find module 'isarray'
at Function.Module._resolveFilename (module.js:476:15)
at Function.Module._load (module.js:424:25)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.
Please suggest if we have to do anything else.
Thanks, Anjana
I have got exactly the same problem ! Any solutions ?
Hello AjayKumaraj, did you get a solution for this one. I also tried your solution without success ; same problem. Also trie it on AWS, no sucess. Tried it on a local VM ( But this is not an option for me ), it works. Do we nedd a special version of the host OS ? I have tried RHEL and Centos 7.
I'm having the same problem. /usr/local/lib/node_modules/npm/bin/npm-cli.js:82 let notifier = require('update-notifier')({pkg}) ^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:373:25) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module.runMain (module.js:441:10) at startup (node.js:140:18) at node.js:1043:3 ERROR: Service 'microservice' failed to build: The command '/bin/sh -c npm install --silent -g npm && npm install --silent --prod && npm prune --prod' returned a non-zero code: 1
When I modified microservice/Dockerfile from node:4-slim to node:6-slim per @slaterx above, I got a different error message
module.js:478 throw err; ^
Error: Cannot find module 'strip-ansi'
at Function.Module._resolveFilename (module.js:476:15)
at Function.Module._load (module.js:424:25)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.
Changed it to node:5-slim threw a different error. Anyone have any idea what's going on? Anyone have a working Docker image instead?
@Anjana-rak + @djans, I was able to complete this by changing both microservice/Dockerfile and microservice/Dockerfile from node:4-slim to node:8-slim.
o$ docker-compose -f docker-compose-microgateway.yaml ps
Name Command State Ports
--------------------------------------------------------------------------
esmaster /docker-entrypoint.sh /bin ... Up 9200/tcp, 9300/tcp
microgateway /bin/sh -c /usr/bin/app.sh ... Up
microservice /bin/sh -c /usr/bin/app.sh ... Up 8080/tcp
Not fully tested the services though