clinicjs / node-clinic

Clinic.js diagnoses your Node.js performance issues
https://clinicjs.org
MIT License
5.67k stars 125 forks source link

Can't run Clinic on macOS #361

Closed rubencosta13 closed 2 years ago

rubencosta13 commented 2 years ago

Expected Behavior

clinic --help should print clinicjs informations, however on macOS (Version 13), upon installing doesn't behave as expected

Current Behavior

When using ZSH and npm install -g clinic to install it, it works, however when running with the CLI command clinic ZSH returns zsh: command not found: clinic

Steps to Reproduce (for bugs)

1.Install globally clinic 2.Run clinic --help

Environment

RafaelGSS commented 2 years ago

cc @mcollina can you confirm that? I don't use macOS

mcollina commented 2 years ago

works perfectly here on Node v16.

rubencosta13 commented 2 years ago

works perfectly here on Node v16.

Thats odd, couldn't make it to work following the guide. (Installed node via homebrew)

RafaelGSS commented 2 years ago

works perfectly here on Node v16.

Thats odd, couldn't make it to work following the guide. (Installed node via homebrew)

Looks like it's not really installing it globally. npx clinic --help should works

rubencosta13 commented 2 years ago

When running npx clinic --help I got an error:

/Users/rcosta/npm-global/lib/node_modules/clinic/node_modules/macos-release/index.js:27
        const [name, version] = nameMap.get(release);
                                ^

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at macosRelease (/Users/rcosta/npm-global/lib/node_modules/clinic/node_modules/macos-release/index.js:27:26)
    at osName (/Users/rcosta/npm-global/lib/node_modules/clinic/node_modules/os-name/index.js:21:18)
    at new Insight (/Users/rcosta/npm-global/lib/node_modules/clinic/node_modules/insight/lib/index.js:37:13)
    at Object.<anonymous> (/Users/rcosta/npm-global/lib/node_modules/clinic/bin.js:29:17)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47
rubencosta13 commented 2 years ago

I'm on ventura, [22, ['Ventura', '13']], adding this to /Users/rcosta/npm-global/lib/node_modules/clinic/node_modules/macos-release/index.js on const nameMap = new Map([ fixes the issue on macos 13

RafaelGSS commented 2 years ago

I think it was solved in: https://github.com/clinicjs/node-clinic/pull/359. Let me release the package

RafaelGSS commented 2 years ago

try install the package again, please

rubencosta13 commented 2 years ago

Working now!