centreee
centreee

Reputation: 137

Applescript Shell Script

This works in Terminal

sudo npm install ios-sim -g

so why does this not work in AppleScript:

do shell script "cd /usr/local/lib/node_modules/npm;" & "install ios-sim - g" with administrator privileges

Upvotes: 0

Views: 209

Answers (2)

glenn jackman
glenn jackman

Reputation: 247210

You're not calling the same command and you're using different arguments:

npm install ios-sim -g
^^^                 ^^

versus

install ios-sim - g
^^^^^^^         ^ ^

Upvotes: 2

adamh
adamh

Reputation: 3292

Could be a formatting issue, add a space after the semi-colon and remove the space on the -g arg.

eg,

do shell script "cd /usr/local/lib/node_modules/npm; " & "install ios-sim -g" with administrator privileges

Failing this, let us know what the result and/or error is in Applescript Editor.

Upvotes: -1

Related Questions