fix: hard code node path

This commit is contained in:
Innei
2022-03-09 23:43:14 +08:00
parent 7bfb513756
commit 814d82b2a7

View File

@@ -1,4 +1,9 @@
const { cpus } = require('os') const { cpus } = require('os')
const { execSync } = require('child_process')
const nodePath = execSync(`npm root --quiet -g`, { encoding: 'utf-8' }).split(
'\n',
)[0]
const cpuLen = cpus().length const cpuLen = cpus().length
module.exports = { module.exports = {
apps: [ apps: [
@@ -13,6 +18,7 @@ module.exports = {
args: '--color', args: '--color',
env: { env: {
NODE_ENV: 'production', NODE_ENV: 'production',
NODE_PATH: nodePath,
}, },
}, },
], ],