I\'ve been having a lot of trouble trying to get a Jenkinsfile to work. I\'ve been trying to run this test script:
#!/usr/bin/env groovy node { stage(\'
So it seems the reason was that the global property PATH was causing the issue. By going to Manage Jenkins -> Configure System and deleting the PATH global property solved my issue. See JENKINS-41339.
PATH
Manage Jenkins
Configure System