简体   繁体   English

NPM在Amazon EC2 Linux上安装错误MEAN.js示例应用程序?

[英]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. 我使用Mac OS计算机上的外壳连接到运行Linux AMI的Amazon EC2实例。 I then CD into the development file and git clone the mean.js boilerplate/sample application. 然后,将CD放入开发文件中,并git克隆mean.js样板/示例应用程序。 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/ . 这里是mean.js的GIT仓库https://github.com/meanjs/mean ,这是我遵循的教程https://blog.codeship.com/running-mean-web-application-docker-containers-aws/ I then CD into the meanjs folder and run the npm install command. 然后,我将CD插入meanjs文件夹并运行npm install命令。 I then get a bunch of errors intermittently says npm ERR! registry error parsing json 然后,我间歇性地收到一堆错误,提示npm ERR! registry error parsing json npm ERR! registry error parsing json . npm ERR! registry error parsing json Finally right before npm install is finished running it returns the following error: 最后,在npm安装完成运行之前,它会返回以下错误:

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. 奇怪的是,我可以在执行bower install命令后运行该应用程序,该命令通常由npm安装自动完成,但也许不是因为它被npm错误暂停了。

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. 我注意到错误涉及到node-pre-gyp,这是我在Mac OS上全局安装的,用于另一个项目,所以我做了一个npm卸载node-pre-gyp,它说未安装模块。

build an older node in docker container then run the npm install again 在Docker容器中构建一个较旧的节点,然后再次运行npm install

Also, This can help to build node https://registry.hub.docker.com/u/maccam912/meanjs/dockerfile/ 另外,这可以帮助构建节点https://registry.hub.docker.com/u/maccam912/meanjs/dockerfile/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM