Osacompile: no such component "javascript"

May 2, 2017

This happens when the system’s installation of osascripts is broken, which happen when, for example, some idiot just deletes something he shouldn’t. osacompile converts different languages to AppleScript. In this case, brunch was using it to compile js that would show a native notification. Run osalang -l in a terminal. If it does not give you a list of languages, you’ve found your problem.

You can probably fix it by (re-)installing the XCode Command Line Tools, or XCode itself. I just disabled native notifications in brunch and moved on with my life, gracefully. To do so, add notifications: false to brunch-config.js.

/Users/user/project/assets/node_modules/tag-shell/index.js:24
  if (proc.status) throw new Error(`${proc.stderr}`.trim());
                   ^

Error: osacompile: no such component "JavaScript".
  at sync (/Users/user/project/assets/node_modules/tag-shell/index.js:24:26)
  at /Users/user/project/assets/node_modules/tag-shell/ind    return {allSourceFiles, sourceFiles, path, targets, type};
ex.js:18:10
  at getAppPath (/Users/user/project/assets/node_modules/native-notifier/macos/index.js:14:7)
  at Object.module.exports.opts [as notify] (/Users/user/project/assets/node_modules/native-notifier/macos/index.js:29:19)
  at Object._notify (/Users/user/project/assets/node_modules/brunch/node_modules/loggy/index.js:73:10)
  at Object.logger.(anonymous function) [as error] (/Users/user/project/assets/node_modules/brunch/node_modules/loggy/index.js:101:12)
  at fileList.files.forEach.file (/Users/user/project/assets/node_modules/brunch/lib/fs_utils/write.js:103:28)
  at Map.forEach (native)
  at checkWritten (/Users/user/project/assets/node_modules/brunch/lib/fs_utils/write.js:102:18)
  at write (/Users/user/project/assets/node_modules/brunch/lib/fs_utils/write.js:133:3)
  at BrunchWatcher.compile (/Users/user/project/assets/node_modules/brunch/lib/watch.js:293:5)
  at FileList.fileList.on (/Users/user/project/assets/node_modules/brunch/lib/watch.js:154:14)
  at emitNone (events.js:86:13)
  at FileList.emit (events.js:188:7)
  at Timeout.timer.setTimeout [as _onTimeout] (/Users/user/project/assets/node_modules/brunch/lib/fs_utils/file_list.js:171:14)
  at ontimeout (timers.js:386:14)
  at tryOnTimeout (timers.js:250:5)
  at Timer.listOnTimeout (timers.js:214:5)
osacompile: no such component "JavaScript" - May 2, 2017 - mw