Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in step 5 #43

Open
AjayKumaraj opened this issue May 24, 2018 · 6 comments
Open

error in step 5 #43

AjayKumaraj opened this issue May 24, 2018 · 6 comments

Comments

@AjayKumaraj
Copy link

/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

@slaterx
Copy link

slaterx commented May 24, 2018

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

@apilabs
Copy link

apilabs commented Jun 9, 2018

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. (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js:32:15)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445: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

Please suggest if we have to do anything else.

Thanks,
Anjana

@djans
Copy link

djans commented Jun 10, 2018

I have got exactly the same problem ! Any solutions ?

@djans
Copy link

djans commented Jun 18, 2018

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.

@iutomo
Copy link

iutomo commented Jul 17, 2018

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. (/usr/local/lib/node_modules/npm/node_modules/wide-align/node_modules/string-width/index.js:2:17)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445: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

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?

@iutomo
Copy link

iutomo commented Jul 17, 2018

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants