I've got an instance of Apostrophe-CMS which I'm trying to deploy to production at the moment. Running sudo npm start
works fine and the application boots. However, when I try to have the pm2 daemon run it I'm getting a symlink error:
Error: EEXIST: file already exists, symlink '/var/sites/hackday-2016-microsite/node_modules/apostrophe/lib/modules/apostrophe-assets/public' -> '/var/sites/hackday-2016-microsite/public/modules/apostrophe-assets'
hackday2016-28 at Error (native)
hackday2016-28 at Object.fs.symlinkSync (fs.js:1048:18)
hackday2016-28 at Object.self.linkAssetFolderOnUnix (/var/sites/hackday-2016-microsite/node_modules/apostrophe/lib/modules/apostrophe-assets/index.js:447:10)
hackday2016-28 at Object.self.linkAssetFolder (/var/sites/hackday-2016-microsite/node_modules/apostrophe/lib/modules/apostrophe-assets/index.js:424:14)
hackday2016-28 at /var/sites/hackday-2016-microsite/node_modules/apostrophe/lib/modules/apostrophe-assets/index.js:402:14
hackday2016-28 at /var/sites/hackday-2016-microsite/node_modules/lodash/index.js:3073:15
hackday2016-28 at baseForOwn (/var/sites/hackday-2016-microsite/node_modules/lodash/index.js:2046:14)
hackday2016-28 at /var/sites/hackday-2016-microsite/node_modules/lodash/index.js:3043:18
hackday2016-28 at Function.<anonymous> (/var/sites/hackday-2016-microsite/node_modules/lodash/index.js:3346:13)
hackday2016-28 at self.symlinkModules (/var/sites/hackday-2016-microsite/node_modules/apostrophe/lib/modules/apostrophe-assets/index.js:398:9)
hackday2016-28 at /var/sites/hackday-2016-microsite/node_modules/async/lib/async.js:718:13
hackday2016-28 at iterate (/var/sites/hackday-2016-microsite/node_modules/async/lib/async.js:262:13)
hackday2016-28 at async.forEachOfSeries.async.eachOfSeries (/var/sites/hackday-2016-microsite/node_modules/async/lib/async.js:281:9)
hackday2016-28 at _parallel (/var/sites/hackday-2016-microsite/node_modules/async/lib/async.js:717:9)
hackday2016-28 at Object.async.series (/var/sites/hackday-2016-microsite/node_modules/async/lib/async.js:739:9)
hackday2016-28 at Object.self.afterInit (/var/sites/hackday-2016-microsite/node_modules/apostrophe/lib/modules/apostrophe-assets/index.js:349:20)