Skip to main content
added 426 characters in body
Source Link

I have a call (“mercury-parser” via Yarn, using the full path to the call) that converts Web pages to lines of structured text (the page used in the call describes the service):

/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source

If I run it in Terminal (using either /bin/bash or /bin/sh on a 2013 Mac Pro, macOS 10.14.5), I get the proper result: fourteen lines of structured text from the Web page.

However, the very same call returns an error when run as a single-line, “do shell script” AppleScript:

do shell script "/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source"

The error returned is:

enverror "env: node: No such file or directorydirectory" number 127

FWIW, here are both my .profile and my .bash_profile texts (the latter created solely to try and solve this quandary), that should not be necessary, given that the full path to the call is being specified, specifically to avoid such an error:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh  # This loads NVM

source ~/.nvm/nvm.sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

What do I have to do to get the call to run as an AppleScript?

[2019.6.26 at 11:25:45PM: Edited in an attempt at clarification.]

2019.6.27 at 1:36:57PM: Per Mark’s suggestion:

Thank you, Mark; I duplicated my .[bash_]profile, renamed it to “.bashrc”, and added “bin/bash” to the call:

do shell script "bin/bash; /Users/RF/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source"

However, (after a reboot) I still get the same error:

error "env: node: No such file or directory" number 127

Thoughts?

I have a call (“mercury-parser” via Yarn, using the full path to the call) that converts Web pages to lines of structured text (the page used in the call describes the service):

/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source

If I run it in Terminal (using either /bin/bash or /bin/sh on a 2013 Mac Pro, macOS 10.14.5), I get the proper result: fourteen lines of structured text from the Web page.

However, the very same call returns an error when run as a single-line, “do shell script” AppleScript:

do shell script "/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source"

The error returned is:

env: node: No such file or directory

FWIW, here are both my .profile and my .bash_profile texts (the latter created solely to try and solve this quandary), that should not be necessary, given that the full path to the call is being specified, specifically to avoid such an error:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh  # This loads NVM

source ~/.nvm/nvm.sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

What do I have to do to get the call to run as an AppleScript?

[2019.6.26 at 11:25:45PM: Edited in an attempt at clarification.]

I have a call (“mercury-parser” via Yarn, using the full path to the call) that converts Web pages to lines of structured text (the page used in the call describes the service):

/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source

If I run it in Terminal (using either /bin/bash or /bin/sh on a 2013 Mac Pro, macOS 10.14.5), I get the proper result: fourteen lines of structured text from the Web page.

However, the very same call returns an error when run as a single-line, “do shell script” AppleScript:

do shell script "/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source"

The error returned is:

error "env: node: No such file or directory" number 127

FWIW, here are both my .profile and my .bash_profile texts (the latter created solely to try and solve this quandary), that should not be necessary, given that the full path to the call is being specified, specifically to avoid such an error:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh  # This loads NVM

source ~/.nvm/nvm.sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

What do I have to do to get the call to run as an AppleScript?

[2019.6.26 at 11:25:45PM: Edited in an attempt at clarification.]

2019.6.27 at 1:36:57PM: Per Mark’s suggestion:

Thank you, Mark; I duplicated my .[bash_]profile, renamed it to “.bashrc”, and added “bin/bash” to the call:

do shell script "bin/bash; /Users/RF/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source"

However, (after a reboot) I still get the same error:

error "env: node: No such file or directory" number 127

Thoughts?

added 51 characters in body; edited title
Source Link

Node program runsProgram Runs in Terminal, but not asNot As a service or on command “do shell script” from AppleScript

I have a call (mercury“mercury-parserparser” via Yarn, using the full path to the call) that converts Web pages to lines of structured text. It runs in node on 3.5 GHz, 6-Core Mac Pro (MacPro6,1) with 16GB RAM and D700 GPUs, running macOS 10.14.5 very well, but I’m struggling to run it as a service / on demand without opening terminal app and typing.

I would much prefer it to run within an AppleScript. Here isthe page used in the line of codecall describes the service):

/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source

If I run it in Terminal (using either /bin/bash or /bin/sh on a 2013 Mac Pro, macOS 10.14.5), I get the proper result: fourteen lines of structured text from the Web page.

If I run it in a shell script, starting with either “#!/bin/sh” or “#!/bin/bash”However, I get: env: node: No such file or directory If Ithe very same call returns an error when run it in Script Editor as: do shell script "/Users/me/.yarn/bin/mercury a single-parser https://postlight.com/trackchanges/mercury-goes-open-source" I get: envline, “do shell script” AppleScript: node

do shell script "/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source"

The error returned is: No such file or directory

env: node: No such file or directory

HereFWIW, here are both my .profile and my .bash_profile texts (the latter created solely to try and solve this quandary), that should not be necessary, given that the full path to the call is being specified, specifically to avoid such an error:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh  # This loads NVM

source ~/.nvm/nvm.sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

What do I have to do to get the codecall to run outside of Terminalas an AppleScript?

[2019.6.26 at 11:25:45PM: Edited in an attempt at clarification.]

Node program runs in Terminal, but not as a service or on command “do shell script” from AppleScript

I have a call (mercury-parser via Yarn) that converts Web pages to lines of structured text. It runs in node on 3.5 GHz, 6-Core Mac Pro (MacPro6,1) with 16GB RAM and D700 GPUs, running macOS 10.14.5 very well, but I’m struggling to run it as a service / on demand without opening terminal app and typing.

I would much prefer it to run within an AppleScript. Here is the line of code:

/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source

If I run it in Terminal (using either /bin/bash or /bin/sh), I get the proper result: fourteen lines of structured text from the Web page.

If I run it in a shell script, starting with either “#!/bin/sh” or “#!/bin/bash”, I get: env: node: No such file or directory If I run it in Script Editor as: do shell script "/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source" I get: env: node: No such file or directory

Here are both my .profile and my .bash_profile texts:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh  # This loads NVM

source ~/.nvm/nvm.sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

What do I have to do to get the code to run outside of Terminal?

Node Program Runs in Terminal, but Not As a “do shell script” AppleScript

I have a call (“mercury-parser” via Yarn, using the full path to the call) that converts Web pages to lines of structured text (the page used in the call describes the service):

/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source

If I run it in Terminal (using either /bin/bash or /bin/sh on a 2013 Mac Pro, macOS 10.14.5), I get the proper result: fourteen lines of structured text from the Web page.

However, the very same call returns an error when run as a single-line, “do shell script” AppleScript:

do shell script "/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source"

The error returned is:

env: node: No such file or directory

FWIW, here are both my .profile and my .bash_profile texts (the latter created solely to try and solve this quandary), that should not be necessary, given that the full path to the call is being specified, specifically to avoid such an error:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh  # This loads NVM

source ~/.nvm/nvm.sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

What do I have to do to get the call to run as an AppleScript?

[2019.6.26 at 11:25:45PM: Edited in an attempt at clarification.]

deleted 31 characters in body; edited tags; edited title
Source Link
bmike
  • 246.4k
  • 80
  • 444
  • 1k

Call Runs Node program runs in Terminal, but Not withnot as a service or on command “do shell script” or Shell Scriptfrom AppleScript

<I have a call (mercury-parser via Yarn) that converts Web pages to lines of structured text. It runs in node on 3.5 GHz, 6-Core Mac Pro (MacPro6,1) with 16GB RAM and D700 GPUs, running macOS 10.14.5 >

Greetingsvery well, folks!

I havebut I’m struggling to run it as a callservice (mercury-parser via Yarn) that converts Web pages to lines of structured text/ on demand without opening terminal app and typing.

I have not been able to run it outside of Terminal (where it runs like a charm!). I would much prefer it to run within an AppleScript. Here is the line of code:

/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source

If I run it in Terminal (using either /bin/bash or /bin/sh), I get the proper result: fourteen lines of structured text from the Web page. If

If I run it in a shell script, starting with either “#!/bin/sh” or “#!/bin/bash”, I get: env: node: No such file or directory If I run it in Script Editor as: do shell script "/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source" I get: env: node: No such file or directory

Here are both my .profile and my .bash_profile texts:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh  # This loads NVM

source ~/.nvm/nvm.sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

What do I have to do to get the code to run outside of Terminal?

Blessings, and thank you!

Richard Fairbanks

Call Runs in Terminal, but Not with “do shell script” or Shell Script

< 3.5 GHz, 6-Core Mac Pro (MacPro6,1) with 16GB RAM and D700 GPUs, running macOS 10.14.5 >

Greetings, folks!

I have a call (mercury-parser via Yarn) that converts Web pages to lines of structured text.

I have not been able to run it outside of Terminal (where it runs like a charm!). I would much prefer it to run within an AppleScript. Here is the line of code:

/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source

If I run it in Terminal (using either /bin/bash or /bin/sh), I get the proper result: fourteen lines of structured text from the Web page. If I run it in a shell script, starting with either “#!/bin/sh” or “#!/bin/bash”, I get: env: node: No such file or directory If I run it in Script Editor as: do shell script "/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source" I get: env: node: No such file or directory

Here are both my .profile and my .bash_profile texts:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh  # This loads NVM

source ~/.nvm/nvm.sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

What do I have to do to get the code to run outside of Terminal?

Blessings, and thank you!

Richard Fairbanks

Node program runs in Terminal, but not as a service or on command “do shell script” from AppleScript

I have a call (mercury-parser via Yarn) that converts Web pages to lines of structured text. It runs in node on 3.5 GHz, 6-Core Mac Pro (MacPro6,1) with 16GB RAM and D700 GPUs, running macOS 10.14.5 very well, but I’m struggling to run it as a service / on demand without opening terminal app and typing.

I would much prefer it to run within an AppleScript. Here is the line of code:

/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source

If I run it in Terminal (using either /bin/bash or /bin/sh), I get the proper result: fourteen lines of structured text from the Web page.

If I run it in a shell script, starting with either “#!/bin/sh” or “#!/bin/bash”, I get: env: node: No such file or directory If I run it in Script Editor as: do shell script "/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source" I get: env: node: No such file or directory

Here are both my .profile and my .bash_profile texts:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh  # This loads NVM

source ~/.nvm/nvm.sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

What do I have to do to get the code to run outside of Terminal?

added 1 character in body
Source Link
Loading
Source Link
Loading