{"id":17472693,"url":"https://github.com/shinnn/win-user-installed-npm-cli-path","last_synced_at":"2025-08-07T01:26:20.313Z","repository":{"id":65997889,"uuid":"45771747","full_name":"shinnn/win-user-installed-npm-cli-path","owner":"shinnn","description":"Resolve the path of `npm-cli.js` included in the user-installed npm on Windows","archived":false,"fork":false,"pushed_at":"2019-05-31T00:17:50.000Z","size":108,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-19T12:22:27.161Z","etag":null,"topics":["javascript","nodejs","npm","path","promise","resolution","windows"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shinnn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-08T07:49:24.000Z","updated_at":"2024-07-01T19:26:01.000Z","dependencies_parsed_at":"2023-03-10T23:00:33.791Z","dependency_job_id":null,"html_url":"https://github.com/shinnn/win-user-installed-npm-cli-path","commit_stats":{"total_commits":38,"total_committers":1,"mean_commits":38.0,"dds":0.0,"last_synced_commit":"7630909e0d074c5c2be53bd435997c45d83e716b"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/shinnn/win-user-installed-npm-cli-path","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fwin-user-installed-npm-cli-path","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fwin-user-installed-npm-cli-path/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fwin-user-installed-npm-cli-path/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fwin-user-installed-npm-cli-path/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shinnn","download_url":"https://codeload.github.com/shinnn/win-user-installed-npm-cli-path/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fwin-user-installed-npm-cli-path/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269185264,"owners_count":24374609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","nodejs","npm","path","promise","resolution","windows"],"created_at":"2024-10-18T17:33:57.883Z","updated_at":"2025-08-07T01:26:20.283Z","avatar_url":"https://github.com/shinnn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# win-user-installed-npm-cli-path\n\n[![npm version](https://img.shields.io/npm/v/win-user-installed-npm-cli-path.svg)](https://www.npmjs.com/package/win-user-installed-npm-cli-path)\n[![Build Status](https://travis-ci.com/shinnn/win-user-installed-npm-cli-path.svg?branch=master)](https://travis-ci.com/shinnn/win-user-installed-npm-cli-path)\n[![Build status](https://ci.appveyor.com/api/projects/status/2sp4jxe2rp48lnk2/branch/master?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/win-user-installed-npm-cli-path/branch/master)\n[![Coverage Status](https://img.shields.io/coveralls/shinnn/win-user-installed-npm-cli-path.svg)](https://coveralls.io/github/shinnn/win-user-installed-npm-cli-path)\n\nResolve the path of [`npm-cli.js`][npm-cli] included in [user-installed](https://docs.npmjs.com/getting-started/installing-node#updating-npm) [npm](https://www.npmjs.com/) on [Windows](https://www.microsoft.com/windows)\n\n```javascript\nconst winUserInstalledNpmCliPath = require('win-user-installed-npm-cli-path');\n\n(async () =\u003e {\n  const cliPath = await winUserInstalledNpmCliPath();\n  //=\u003e 'C:\\\\Users\\\\me\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\npm\\\\bin\\\\npm-cli.js'\n  });\n})();\n```\n\n## Installation\n\n[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).\n\n```\nnpm install win-user-installed-npm-cli-path\n```\n\n## API\n\n```javascript\nconst winUserInstalledNpmCliPath = require('win-user-installed-npm-cli-path');\n```\n\n### winUserInstalledNpmCliPath()\n\nReturn: `Promise\u003cstring\u003e`\n\nIt resolves the path of [`npm-cli.js`][npm-cli] included in the user-installed [`npm` CLI](https://github.com/npm/npm) on Windows. *\"User-installed\"* means that it has been installed with [`npm install --global npm`](https://docs.npmjs.com/getting-started/installing-node#updating-npm) command by the user, and it might be located on the path different from where the default Node.js-bundled npm has been installed.\n\nIt uses global [`prefix`](https://docs.npmjs.com/files/folders#prefix-configuration) [config](https://docs.npmjs.com/misc/config#prefix) as a base path for searching npm CLI location.\n\n```javascript\n// npm config set prefix tmp --global\n\n(async () =\u003e {\n  await winUserInstalledNpmCliPath();\n  //=\u003e 'C:\\projects\\your_project\\tmp\\node_modules\\npm\\bin\\npm-cli.js'\n})();\n```\n\n## For [POSIX](http://standards.ieee.org/develop/wg/POSIX.html)\n\nUse [real-executable-path](https://github.com/shinnn/real-executable-path) instead.\n\n```javascript\nconst realExecutablePath = require('real-executable-path');\n\n(async () =\u003e {\n  await realExecutablePath('npm');\n  //=\u003e '/usr/local/lib/node_modules/npm/bin/npm-cli.js'\n})();\n```\n\n## License\n\n[ISC License](./LICENSE) © 2017 - 2019 Watanabe Shinnosuke\n\n[npm-cli]: https://github.com/npm/npm/blob/master/bin/npm-cli.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fwin-user-installed-npm-cli-path","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinnn%2Fwin-user-installed-npm-cli-path","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fwin-user-installed-npm-cli-path/lists"}