Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bin
AgeCommit message (Collapse)Author
2021-11-05chore: update to latest eslint and linting rulesGar
This brings us in line with the rest of the linting rules we are wanting to use on the npm cli repos. There were several hundred over-length lines and instead of editing them all by hand I piped the failing file through `prettier` and back through `eslint` just to save some time and energy. This means there may be some quirks in the linting those files have, but we can fix those if we see them and they bother us. Other than that there were about 50 lines that are legitimately over-length, all are now explicitly overridden. Many are tests that could be snapshots. PR-URL: https://github.com/npm/cli/pull/3995 Credit: @wraithgar Close: #3995 Reviewed-by: @lukekarrys
2021-06-23chore(linting): add bin and clean up lib/ls.jsIvan
This adds linting checking to our bin directory, fixes the linting errors that generated, and cleans up lib/ls.js to remove unused variables. PR-URL: https://github.com/npm/cli/pull/3454 Credit: @Ivan12273 Close: #3454 Reviewed-by: @darcyclarke
2021-03-18update lib/*.js to use new config structuresisaacs
2021-03-05Get correct npm prefix on all Windows unix shellsisaacs/fix-windows-shell-binsisaacs
1. Set the shebang to /usr/bin/env bash instead of /bin/sh (which might be dash or some other shell) 2. Use Unix-style line endings, not Windows-style (Cygwin accepts either, but mingw bash sometimes objects, and WSL bash always does) 3. Test against paths using wslpath if available, but still pass win32 paths to node.exe, since it is a Windows binary that only knows how to handle Windows paths. This makes npm as installed by the Node.js Windows MSI installer behave properly under WSL, Cygwin, MINGW Git Bash, and the internal MINGW Git Bash when posix CLI utilities are exposed to the cmd.exe shell. The test is not quite as comprehensive as I'd like. It runs on the various Windows bash implementations if they are found in their expected locations, skipping any that are not installed. Short of shipping mingw, cygwin, and wsl as test fixtures, I'm not sure how we could do much better, however. At least, we can use this test to assist debug and catch issues on Windows machines (ours or users who report problems). PR-URL: https://github.com/npm/cli/pull/2789 Credit: @isaacs Close: #2789 Reviewed-by: @nlf
2020-10-06set executable permissions on bins that node installer usesisaacs
2020-10-06Revert "Remove unused npx binary"Myles Borins
This reverts commit f019a248a67e8c46dbe41bf31f4818c5ca2138bf. Git Bash on Windows still uses this file. Removing it broke the windows MSI builds in Node.js infrastructure. Unless we absolutely need to remove this I think it is worth keeping around PR-URL: https://github.com/npm/cli/pull/1903 Credit: @MylesBorins Close: #1903 Reviewed-by: @isaacs
2020-09-18Remove unused npx binaryisaacs
Close: https://github.com/npm/cli/pull/1792
2020-08-18use @npmcli/config for configurationisaacs
This also refactors the completion.js command, still pending proper tests.
2020-08-05chmod npx to 0755isaacs
2020-08-04npx: add install prompt, handle options correctlyisaacs
- handle previous npx options that are still possible to be handled, and print a warning if any deprecated/removed options are used. - expand shorthands properly in npx command line. - take existing npm options into account when determining placement of the -- argument. - document changes from previous versions of npx. PR-URL: https://github.com/npm/cli/pull/1596 Credit: @isaacs Close: #1596 Reviewed-by: @ruyadorno
2020-07-31Add 'npm exec', port npx to use it directlyisaacs
This removes libnpx, and adds a new command, 'npm exec', which implements the functionality. As of this change going live, we are dropping support for the standalone top-level package 'npx'. Not all of the functionality of the old version of npx is maintained. The shell fallback functionality is dropped. It's insecure, and not something we want to support or encourage. If anyone wants it, they can hack up their .bashrc file themselves. --no-install is not supported. If the package is not found locally, it is installed in a predictable location in the cache, rather than failing. This is something we might want to review, as automatically installing in the case of misspellings may be a security footgun. --ignore-existing is dropped. Existing packages are always given priority. --quiet or -q can be accomplished by using the --silent npm option, so it's also dropped. --npm option is dropped. npx will always use the npm that it ships with. --node-arg is dropped. There are other ways to set node options via environment variables in the Node.js versions we support. --always-spawn is dropped. npx will always spawn a child process to execute commands. The --shell option can be accomplished by using the --script-shell npm option. --version and --help are just passed through to npm. As an added bonus, I noticed that the files in `bin/` were not getting run. So now we have full coverage for npm-cli.js and npx-cli.js. PR-URL: https://github.com/npm/cli/pull/1588 Credit: @isaacs Close: #1588 Reviewed-by: @ruyadorno
2020-07-29refactor and test for main cli scriptisaacs
2020-07-29move update-notifier into separate moduleisaacs
2020-07-29update dependencies, refactor config loading to asyncisaacs
This removes a lot of very outdated dependencies, updates many to their modern (usually promisified) versions, and updates (or removes) code to account for the change. Several dependencies have been completely removed, and others a bit shuffled around, so that the node_modules folder can be bundled somewhat more optimally than it would have otherwise.
2020-07-29First pass refactoring npm.js and npm-cli.jsisaacs
- Several sections of code moved out into separate modules. - npm is an instance of an inline class. - uses a Proxy for npm.commands object instead of the old hand-rolled Proxy-esque thing. - organized code path for outputting usage/help information.
2019-12-02Revert "windows: Add preliminary WSL support for npm and npx"Craig Loewen
This reverts commit 3471d5200217bfa612b1a262e36c9c043a52eb09. PR-URL: https://github.com/npm/cli/pull/527 Credit: @craigloewen-msft Close: #527 Reviewed-by: @mikemimik
2019-11-14windows: Add preliminary WSL support for npm and npxjoan xie
This commit would make it possible to run `npm` installed on Windows within Windows Subsystem for Linux. It is required, however, that the end of line characters of `npm` and `npx` be `\n` for the fix to take effect. PR-URL: https://github.com/npm/cli/pull/253 Credit: @infinnie Close: #253 Reviewed-by: @claudiahdz
2019-08-02Handle unhandledRejections, help with cache eaccesisaacs
Suggested by @godmar in https://npm.community/t/npm-err-cb-never-called-permission-denied/9167/5 Incidentally, this turned up that we're catching uncaughtExceptions in the main npm functions, but not unhandledRejections! Tracing this through, it seems like node-fetch-npm's use of cacache is particularly brittle. Any throw that comes from cacache is not caught properly, since node-fetch-npm is all streams and callbacks. The naive approach (just adding a catch and failing the callback) doesn't work, because then make-fetch-happen and npm-registry-fetch interpret the failure as an invalid response, when actually it was a local cache error. So, a bit more love and polish is definitely still needed in the guts of npm's fetching and caching code paths. In the meantime, though, handling any unhandledRejection at the top level prevents at least the worst and most useless type of error message. PR-URL: https://github.com/npm/cli/pull/227 Credit: @isaacs Close: #227 Reviewed-by: @isaacs
2019-06-30npm checks only node.exe and not node on local dirRaphael Goulais
npm find local node.exe on windows, but relies on global node installation on linux. Added a test to check for a local installation of node before relying on the system wide installation. Close: https://github.com/npm/cli/pull/200
2019-02-14Reduce work to test if executable ends with a 'g'. (#138)Eli Doran
PR-URL: https://github.com/npm/cli/pull/138 Credit: @elidoran Reviewed-By: @aeschright
2018-08-21update-notifier: skip checking for updates in CI environmentsKat Marchán
PR-URL: https://github.com/npm/cli/pull/33 Credit: @Sibiraj-S Reviewed-By: @zkat
2018-08-03cli: don't check for updates to npm when we are updating npm itself (#32)Brian Olore
PR-URL: https://github.com/npm/cli/pull/32 Credit: @olore Reviewed-By: @zkat
2018-07-13docs: replace references to the old repo or issue tracker (#5)Kat Marchán
2018-06-29config: Enable config for suppressing update-notifier (#20750)Matt Travi
PR-URL: https://github.com/npm/npm/pull/20750 Credit: @travi Reviewed By: @zkat
2018-05-16update-notifier: remove colon + support canary (#20536)Kat Marchán
PR-URL: https://github.com/npm/npm/pull/20536 Credit: @zkat Reviewed-By: @iarna
2018-04-11cli: shinier update-notifierKat Marchán
This message is based on the one pnpm uses, which I think takes care of all the false update messages and missing -g that happens with the default notifier message. It also tells people what "level" the update is. Credit: @zkat PR-URL: https://github.com/npm/npm/pull/20122 Reviewed-By: @iarna
2018-04-04cli: fix easter egg (#20214)Kat Marchán
PR-URL: https://github.com/npm/npm/pull/20214 Credit: @zkat
2018-03-23standardizeRebecca Turner
2018-03-09npx: fix npx prefix issue (#19608)laggingreflex
It was incorrectly calling `node npx-cli prefix` which led to downloading "prefix" package. Instead it should be calling `node npm-cli prefix` PR-URL: https://github.com/npm/npm/pull/19608 Credit: @laggingreflex Reviewed-By: @zkat
2017-08-17bin: Remove unused file, bin/read-package-json.jsEnrico Weigelt, metux IT consult
The script isn't called, isn't made available as a binary. Credit: @metux Reviewed-By: @iarna PR-URL: https://github.com/npm/npm/pull/16547
2017-07-11npx: bundle npx with npm itselfKat Marchán
npx is an npm package runner with a bunch of nice features. While it is also available on the npm registry as `npx`, it's the sort of thing that's better off being bundles with npm itself. Fixes: #6053 PR-URL: https://github.com/npm/npm/pull/17685 Credit: @zkat Reviewed-By: @iarna
2017-05-31standard: minor linter fixKat Marchán
Credit: @zkat
2017-05-27hamilton: Talk less, complete more (#16750)Aria Stewart
PR-URL: https://github.com/npm/npm/pull/16750 Credit: @aredridel Reviewed-By: @zkat
2017-04-18config: don't ham-it-up when expecting parseable output (#16336)Brian Dukes
* Don't ham-it-up when expecting JSON I turned on the ham-it-up configuration setting, and then noticed that I received an error when running the npm-windows-upgrade module, because it was trying to parse the JSON from calling `npm view npm versions --json` and didn't know what to do with the easter egg text at the end. This change disables the ham-it-up text when the json option is present. PR-URL: https://github.com/npm/npm/pull/16336 Credit: @bdukes Reviewed-By: @zkat
2017-04-15npm: Add timing diagnostics on --loglevel=timingRebecca Turner
2017-03-10install: Use EXDEV aware move instead of rename (#15901)Rebecca Turner
This will allow moving across devices and moving when filesystems don't support renaming directories full of files. PR-URL: https://github.com/npm/npm/pull/15901 Credit: @iarna Reviewed-By: @zkat
2017-03-06cli: only use `update-notifier` on supported versionsJoshua Bennett
Fixes: #15855 PR-URL: https://github.com/npm/npm/pull/15864 Credit: @legodude17 Reviewed-By: @iarna
2017-02-24npm-cli: add update-notifier & use itC J Silverio
The cli bin script now runs the update-notifier module after it has decided we're running in a good node version. We do not yet customize the output in any way. Credit: @ceejbot Fixes: #11473 PR-URL: https://github.com/npm/npm/pull/15774#pullrequestreview-23599057 Reviewed-By: @iarna
2016-10-20npm: Detect unsupported Node.js versions and warnRebecca Turner
Also error on really old versions where we know we can't work. Credit: @iarna Reviewed-By: @othiym23 Reviewed-By: @zkat PR-URL: https://github.com/npm/npm/pull/14230
2016-05-04src: bring code up to standard@6 compatibilityForrest L Norvell
Credit: @othiym23 PR-URL: https://github.com/npm/npm/pull/11444 Reviewed-By: @zkat Reviewed-By: @iarna Reviewed-By: @othiym23
2016-02-24npm-bin: Prefer locally installed npm in Git Bash.Hutson Betts
Existing behavior invoking npm within a Git Bash session is to prefer the globally installed instance of `npm`; the instance of npm installed alongside Node when using the Node installer. The cmd script, and the shell script, have been modified in the past to pull a `prefix` setting from the global `npmrc` file, and invoke the `npm` instance located at the `prefix` location. Because the value of `prefix` is the user's AppData directory where npm installs new copies of itself, the user gets the latest installed npm. However, the setup was not extended to support Git Bash. Therefore Git Bash users still get the version of npm installed beside Node. Add support for using the same prefix for invoking the user installed npm in Git Bash sessions. PR-URL: https://github.com/npm/npm/pull/11526 Credit: @destroyerofbuilds Reviewed-By: @iarna Fixes: #11524
2016-01-21node-gyp-bin: fix custom node-gyp env var quotingAlexis Campailla
npm sets node_config_node_gyp without quotes, so its usage should be quoted. Indeed, it is a better practice to define environment variables that contain paths without quotes and quote their usage. PR-URL: https://github.com/npm/npm/pull/11158 Credit: @orangemocha Reviewed-By: @othiym23
2015-10-22src: Update formatting to be compatible with standard@5Sebastiaan Deckers
PR-URL: https://github.com/npm/npm/pull/9954
2015-08-21windows: search for a user-installed npmJoão Reis
This changes npm.cmd and the npm script when running in Cygwin to look for an npm installation in prefix, running it if found. The default npm is used to get the prefix. This implements the changes described in https://github.com/joyent/node/issues/8528 . Fixes joyent/node#8528. Reference: joyent/node#8554. Fixes: #6412 PR-URL: https://github.com/npm/npm/pull/9089
2015-07-25config: Add option to turn off progress barsRebecca Turner
PR-URL: https://github.com/npm/npm/pull/9037 Fixes: https://github.com/npm/npm/issues/8704
2015-06-26src: make the npm source comply with `standard`Forrest L Norvell
This is a huge set of mostly mechanical changes. Going forward, all changes to the npm source base are expected to comply with `standard`, and it's been integrated into the test suite to enforce that. There are a few notes below about specific classes of changes that need to be handled specially for npm's code base. standard: "Expected error to be handled." `standard` only expects errors spelled "err" to be handled. `npm-registry-mock` never actually invokes its callback with an error, so in some cases I just changed it to be spelled "er" and called it good. standard: "Expected a "break" statement before 'case'." This behavior is actually on purpose, and I don't feel like rewriting the affected code right now (or, you know, ever). So I added code comments disabling the checks in the three applicable changes. standard: "x is a function." Rebinding functions created via declarations (as opposed to expressions) is a no-no? PR-URL: https://github.com/npm/npm/pull/8668
2015-06-26Stop stray progressbars from appearing when logging is used in non-progress ↵Rebecca Turner
commands
2015-06-26Swap the spinner out for the new progress bar code in npmlogRebecca Turner
2015-05-22windows: run node-gyp.js instead of opening itbangbang93
PR-URL: https://github.com/npm/npm/pull/8324
2015-02-27node-gyp: enable overriding node-gyp binaryAlain Kalker
Enable overriding the node-gyp binary used by npm by specifying a config option, similar to specifying the python interpreter. Example usage: npm install --node-gyp=<path-to-custom-node-gyp>