如何在 mac OS X 上启动时启动 verdaccio(sinopia 的分叉版本)?

How to launch verdaccio (forked version of sinopia) at boot on mac OS X?

我试图在 /Library/LaunchDaemons 创建 .plist 但它没有 运行。

如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>org.verdaccio</string>
    <key>Program</key>
    <string>/usr/local/bin/verdaccio</string>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
  </dict>
</plist>

提前致谢。

让它工作的正确答案如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>EnvironmentVariables</key>
    <dict>
      <key>PATH</key>
      <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
    </dict>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>org.verdaccio</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/local/bin/verdaccio</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>UserName</key>
    <string>igor</string>
    <key>SessionCreate</key>
    <true/>
  </dict>
</plist>