Skip to content

Conversation

@endel
Copy link
Contributor

@endel endel commented Nov 13, 2024

This PR fixes the issue when trying to run pm2 install @colyseus/tools the second time:

Error:

Error: ENOENT: no such file or directory, mkdir '/tmp/@colyseus/tools'
    at Object.mkdirSync (node:fs:1371:26)
    at copydirSync (/usr/lib/node_modules/pm2/lib/tools/copydirSync.js:38:14)
    at Object.backup (/usr/lib/node_modules/pm2/lib/API/Modules/NPM.js:438:5)
    at /usr/lib/node_modules/pm2/lib/API/Modules/NPM.js:170:16
    at moduleExistInLocalDB (/usr/lib/node_modules/pm2/lib/API/Modules/NPM.js:162:10)
    at Object.install (/usr/lib/node_modules/pm2/lib/API/Modules/NPM.js:166:3)
    at Modularizer.install (/usr/lib/node_modules/pm2/lib/API/Modules/Modularizer.js:48:9)
    at CLI.install (/usr/lib/node_modules/pm2/lib/API/Modules/index.js:27:17)
    at Command.<anonymous> (/usr/lib/node_modules/pm2/lib/binaries/CLI.js:503:9)
    at Command.listener (/usr/lib/node_modules/pm2/node_modules/commander/index.js:315:8) {

The recursive option for mkdirSync is available since Node.js 10.12.0. So this change should be safe for everybody.

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes

@CLAassistant
Copy link

CLAassistant commented Nov 13, 2024

CLA assistant check
All committers have signed the CLA.

@endel
Copy link
Contributor Author

endel commented Sep 1, 2025

Friendly ping @Unitech, here's an updated log:

$ pm2 install @colyseus/tools
[PM2][Module] Installing NPM @colyseus/tools module
[PM2][Module] Module already installed. Updating.
node:fs:1363
  const result = binding.mkdir(
                         ^

Error: ENOENT: no such file or directory, mkdir '/tmp/@colyseus/tools'
    at Object.mkdirSync (node:fs:1363:26)
    at copydirSync (/usr/lib/node_modules/pm2/lib/tools/copydirSync.js:38:14)
    at Object.backup (/usr/lib/node_modules/pm2/lib/API/Modules/NPM.js:435:5)
    at /usr/lib/node_modules/pm2/lib/API/Modules/NPM.js:170:16
    at moduleExistInLocalDB (/usr/lib/node_modules/pm2/lib/API/Modules/NPM.js:162:10)
    at Object.install (/usr/lib/node_modules/pm2/lib/API/Modules/NPM.js:166:3)
    at Modularizer.install (/usr/lib/node_modules/pm2/lib/API/Modules/Modularizer.js:48:9)
    at CLI.install (/usr/lib/node_modules/pm2/lib/API/Modules/index.js:27:17)
    at Command.<anonymous> (/usr/lib/node_modules/pm2/lib/binaries/CLI.js:503:9)
    at Command.listener (/usr/lib/node_modules/pm2/node_modules/commander/index.js:315:8) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'mkdir',
  path: '/tmp/@colyseus/tools'
}

@Unitech
Copy link
Owner

Unitech commented Sep 2, 2025

Thanks for the fix

@Unitech Unitech merged commit eb46b37 into Unitech:development Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants