env:节点:没有这样的文件或目录(使用 Jenkins、Windows 机器、节点和远程 Web 界面)

问题描述 投票:0回答:1

最近我正在做一个 iOS 构建,我通过我的 IP 地址使用远程 Web 界面远程启动 MacOS 代理。

我已经尝试卸载node / npm并重新安装它,但在安装cordova后仍然出现相同的错误。

我还检查了我的节点目录是否没有错误并且没问题:

我也已经尝试过将

set +e
放在 shell 脚本顶部的解决方案,但之后仍然不起作用。

我已经尝试解决这个问题5天了,但仍然没有解决,所以我希望你们能在这种情况下进一步帮助我。

此错误发生在

iOS
构建开始时。

Started by upstream project "CordovaHelloWorld" build number 97
originally caused by:
Started by user (user)
Building remotely on mac-slave (ios) in workspace 
/Users/(username)/Desktop/jenkinsMacSlave/workspace/CordovaHelloWorld/PLATFORM/ios
> git rev-parse --is-inside-work-tree 
# timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/(user)/Jenkins 
# timeout=10
Fetching upstream changes from https://github.com/(user)/Jenkins
> git --version 
# timeout=10
> git fetch --tags --progress https://github.com/(user)/Jenkins 
+refs/heads/:refs/remotes/origin/
Checking out Revision b08e07983673bdc08dcb6e81d65e83a3cb5edc5c 
(origin/Jenkinsios)
> git config core.sparsecheckout 
# timeout=10
> git checkout -f b08e07983673bdc08dcb6e81d65e83a3cb5edc5c
> git rev-list b08e07983673bdc08dcb6e81d65e83a3cb5edc5c 
# timeout=10
[ios] $ /bin/sh -xe 
/var/folders/sj/01rfz4rx1ws_smjvggb_klzw0000gq/T/jenkins150886583207745932.sh
+ set +e
+ /usr/local/bin/cordova platform rm ios --no-telemetry --no-update-notifier
env: node: No such file or directory
+ /usr/local/bin/cordova platform add ios --no-telemetry --no-update-notifier
env: node: No such file or directory
+ /usr/local/bin/cordova build ios --no-telemetry --no-update-notifier
env: node: No such file or directory
Build step 'Execute shell' marked build as failure
Finished: FAILURE

我尝试了很多很多的解决方案,但没有一个有效。 我真的希望这个问题尽快得到解决,已经提前感谢了!

编辑:

我已经尝试过以下答案:

  1. https://github.com/nodejs/node-v0.x-archive/issues/3911
  2. Express.js:没有这样的文件或目录
  3. 无法安装NodeJs:/ usr / bin / env:节点:没有这样的文件或目录
  4. 浏览器错误 /usr/bin/env: 节点:没有这样的文件或目录
node.js cordova jenkins npm jenkins-agent
1个回答
0
投票

已找到解决方案。这是mac Slave的路径问题。需要在Jenkins中添加环境变量:

PATH + LOCAL_BIN
----
/usr/local/bin

© www.soinside.com 2019 - 2024. All rights reserved.