Search code examples
node.jsamazon-web-servicesamazon-ec2meanjs

NPM install error MEAN.js sample application on Amazon EC2 Linux?


I connect to my Amazon EC2 instance running Linux AMI using the shell from my Mac OS Computer. I then CD into the development file and git clone the mean.js boilerplate/sample application. Here the GIT repo for mean.js https://github.com/meanjs/mean and heres the tutorial that I followed https://blog.codeship.com/running-mean-web-application-docker-containers-aws/. I then CD into the meanjs folder and run the npm install command. I then get a bunch of errors intermittently says npm ERR! registry error parsing json . Finally right before npm install is finished running it returns the following error:

npm ERR! Linux 3.14.35-28.38.amzn1.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v0.13.0-pre
npm ERR! npm  v2.11.2
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: node-pre-gyp@'>=0.6.5 <0.7.0'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["0.1.0","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5","0.1.6","0.1.7","0.1.8","0.1.9","0.2.1","0.2.2","0.2.3","0.2.4","0.2.5","0.2.6","0.3.0","0.3.1","0.3.1-alpha","0.4.0","0.4.1","0.4.2"]
npm ERR! notarget 
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget 
npm ERR! notarget It was specified as a dependency of 'v8-profiler'
npm ERR! notarget 

The strange thing is that I was able to run the application after doing a bower install command, which is normally automatically done by the npm install but maybe it wasn't because it was halted by the npm errors.

I noticed the errors refer to node-pre-gyp which is something I installed globally on my Mac OS a while back for another project, so I did an npm uninstall node-pre-gyp and it said the module wasnt installed.


Solution

  • build an older node in docker container then run the npm install again

    Also, This can help to build node https://registry.hub.docker.com/u/maccam912/meanjs/dockerfile/