问题
Lately I am doing an ios build where I remotely launch a mac slave, using a remote web interface through my IP address.
I already tried uninstalling node / npm and reinstalling it, but it still gets the same error after I install cordova.
I also checked if my directory for node wasn't wrong and it's fine:
I also already tried the solution of putting set +e
at the top of my shell script, but after that it still doesn't work.
I am already trying to figure this problem out for 5 days and it still isn't solved, so I hope you guys can try to help me out further in this situation.
This error takes place when the ios
build starts.
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
I have tried many and many solutions, but none worked. I really hope this problem gets fixed soon, already thanks in advance!
EDIT:
I tried these following answers already:
- https://github.com/nodejs/node-v0.x-archive/issues/3911
- Express.js: No Such file or directory
- Cannot install NodeJs: /usr/bin/env: node: No such file or directory
- browserify error /usr/bin/env: node: No such file or directory
回答1:
Solution has been found. It was a path problem with mac slave. needed to add environment variable in Jenkins: PATH + LOCAL_BIN
---- /usr/local/bin
来源:https://stackoverflow.com/questions/43495229/env-node-no-such-file-or-directory-using-jenkings-windows-machine-node-and