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

omqzjyyz  于 2023-11-17  发布在  Jenkins
关注(0)|答案(1)|浏览(195)

最近我正在做一个iOS构建,在那里我远程启动一个MacOS代理,通过我的IP地址使用远程Web界面。
我已经尝试卸载node / npm并重新安装它,但在安装cordova后仍然得到相同的错误。
我还检查了我的node目录是否正确,它很好:
x1c 0d1x的数据
我也已经尝试过将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: No Such file or directory
  3. Cannot install NodeJs: /usr/bin/env: node: No such file or directory
  4. browserify error /usr/bin/env: node: No such file or directory
tpgth1q7

tpgth1q71#

已经找到解决方案。这是mac slave的路径问题。需要在Jenkins中添加环境变量:PATH + LOCAL_BIN-/usr/local/bin

相关问题