TeamCity平台执行npm install没反应

npm版本


TeamCity项目配置为:


执行run项目后,npm install指令一直执行中,但没有任何反应。
没有定位到问题原因,尝试替换为yarn来添加依赖包。

YARN官网:https://yarnpkg.com
下载安装YARN后,TeamCity的Agent服务需要<font color=red>重启</font>下,才能生效。

TeamCity中的任务指令改为yarn,效果如下:


run项目后,可能会报问题:

[15:06:32][Step 1/4] warning There appears to be trouble with your network connection. Retrying...
[15:07:11][Step 1/4] warning There appears to be trouble with your network connection. Retrying...
[15:07:26][Step 1/4] warning There appears to be trouble with your network connection. Retrying...
[15:07:30][Step 1/4] warning There appears to be trouble with your network connection. Retrying...
[15:07:36][Step 1/4] warning babel-preset-es2015@6.24.1: We're super 馃樃  excited that you're trying to use ES2015 syntax, but instead of continuing yearly presets 馃槶 , we recommend using babel-preset-env: npm install babel-preset-env. preset-env without options will compile ES2015+ down to ES5. And by targeting specific browsers, Babel can do less work and you can ship native ES2015+ to users 馃槑 ! Also, we are in the process of releasing v7, so give http://babeljs.io/blog/2017/09/12/planning-for-7.0 a read and test it! Thanks so much for using Babel 馃檹 , please give us a follow @babeljs for updates, join slack.babeljs.io for discussion and help support at opencollective.com/babel
[15:08:07][Step 1/4] warning There appears to be trouble with your network connection. Retrying...
[15:08:19][Step 1/4] warning express@2.5.11: express 2.x series is deprecated
[15:08:19][Step 1/4] warning connect@1.9.2: connect 1.x series is deprecated
[15:08:55][Step 1/4] warning There appears to be trouble with your network connection. Retrying...
[15:09:22][Step 1/4] error An unexpected error occurred: "https://registry.yarnpkg.com/postcss-modules-values: connect ETIMEDOUT 104.16.63.173:443".
[15:09:22][Step 1/4] info If you think this is a bug, please open a bug report with the information provided in "E:\\BuildAgent2\\work\\81f07a77be17b43b\\yarn-error.log".
[15:09:22][Step 1/4] info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[15:09:22][Step 1/4] Process exited with code 1

此问题解决方法参考:http://www.jianshu.com/p/c60bdd6f07be,可在cmd中执行以下指令:

npm config set registry https://registry.npm.taobao.org
npm config set disturl https://npm.taobao.org/dist

这样就可以了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,288评论 19 139
  • 一、Docker创建镜像的方式有两种: 一种通过commit的方式:把做了一系列操作的容器关闭,然后利用docke...
    jie0112阅读 3,872评论 0 3
  • yarn facebook发布的新一代包管理工具,旨在解决以往使用npm作为包管理会遇到的一些问题。从其官方介绍可...
    琢磨先生lf阅读 6,427评论 4 1
  • 最近发现市场上对React Native开发人员的需求挺多的,自己就想学习一下React Native,多一...
    Yao_YongChao阅读 12,381评论 1 6
  • 浮尘满天西风虐, 遮天蔽日黄沙茫, 花草绿叶粉妆浓, 学子清晨除尘忙。 清早,与往常一样出门上班,可到门口发现大不...
    红色安源阅读 1,048评论 1 6