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

时间:2018-03-14 21:02:57

标签: npm sinopia

我试图在/ 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>

提前致谢。

1 个答案:

答案 0 :(得分:2)

使其正常运作的正确答案如下:

<?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>