詹金斯(Jenkins)构建步骤在'npm install< whatever>'上失败 [英] Jenkins build step fails on 'npm install <whatever>'

查看:453
本文介绍了詹金斯(Jenkins)构建步骤在'npm install< whatever>'上失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jenkins的新手:我正在Jenkins建立我们的构建.设置构建步骤以运行nodejs脚本(使用Sencha Touch 2将脚本将构建的应用程序带入本地iOS应用程序的脚本). nodejs脚本需要一个扳手库.

New to Jenkins: I am setting up our build in Jenkins. Setting up a build step to run a nodejs script (a script to take the built app into a native iOS app, with Sencha Touch 2). The nodejs script requires a wrench library.

Jenkins用户似乎在不同的上下文中运行.它看不到我的节点安装或npm安装.作为构建步骤的一部分,我必须将路径导出到node和npm.既然我已经完成了,构建就可以看到node和npm命令.

The Jenkins user appears to be running in a different context. It couldn't see my node installation or npm installation. As part of the build step, I had to export the path to node and npm. Now that I have done that, the build sees the node and npm commands.

但是,在构建步骤中调用的命令之一是"npm install扳手",它给我一个权限错误,并告诉我以管理员身份运行.这样我就可以工作了.

However, one of the commands that I have it calling in the build step is 'npm install wrench' and it gives me a permissions error, and tells me to run as Administrator. So I can get it to work.

因此,我要么需要能够赋予Jenkins用户管理员权限,要么我需要为用户提前npm-install软件包.有谁知道该怎么做?

So I either need to be able to give the Jenkins user admin rights or I need to npm-install the package ahead of time for the user. Does anyone know how to do either of those options.

推荐答案

我猜您正在Mac上运行Jenkins,并且您可能已使用Jenkins Mac安装程序进行了安装.我将进一步猜测您使用默认设置安装了它,这意味着Jenkins被设置为作为启动守护程序运行,并在名为 daemon 的帐户下运行.

I am guessing you are running Jenkins on Mac and you have maybe installed it using the Jenkins Mac installer. I will further guess you installed it with default settings, which means Jenkins is set to run as a launch daemon and running under the account called daemon.

守护程序用户是特殊的.这是非常安全的.守护程序用户的主目录归root用户所有,守护程序在那里没有写权限,因此无法在其中安装任何内容.

The daemon user is special. It is very secure. The home directory of the daemon user is owned by root and daemon has no write permission there, so it is unable to install anything there.

您可以通过重新运行Jenkins安装程序来解决问题,但这一次单击 Customize 按钮.选中显示Start at boot as "jenkins"的框.取消选中显示Start at boot as "daemon"的框.

You can solve your problem by re-running the Jenkins installer but this time click on the Customize button. Check the box that says Start at boot as "jenkins". Uncheck the box that says Start at boot as "daemon".

这篇关于詹金斯(Jenkins)构建步骤在'npm install< whatever>'上失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆