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

时间:2017-04-19 12:03:52

标签: node.js cordova jenkins npm jenkins-slave

最近我正在进行ios构建,我通过我的IP地址使用远程Web界面远程启动mac slave。

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

我还检查了我的节点目录是不是错了,没关系:

enter image description here

我也尝试过将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

1 个答案:

答案 0 :(得分:0)

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