Skip to content

Commit

Permalink
log npm found
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Aug 17, 2024
1 parent 2f9542d commit a51c717
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,9 @@ const getPrefix = () => {

function tryNpmPath() {
try {
if (process.platform === 'win32') {
return fs.realpathSync(require('which').sync('npm.exe'));
} else {
return fs.realpathSync(require('which').sync('npm'));
}
const npm = require('which').sync('npm');
console.log(npm);
return fs.realpathSync(npm);
} catch (err) { /* do nothing */ }
}

Expand Down

0 comments on commit a51c717

Please sign in to comment.