Giter VIP home page Giter VIP logo

install-peerdeps's Introduction

install-peerdeps's People

Contributors

amclin avatar andregeng avatar brucewpaul avatar bytheway875 avatar dependabot-preview[bot] avatar jaredly avatar ljharb avatar nandub avatar nathanhleung avatar vladimyr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

install-peerdeps's Issues

nix the npm dependency

We're really just sending an HTTP request to the registry API, we can take out the npm dependency and just use node's native http.request

Quote packages name, when calling npm

Hi, you need to quote packages names, when you calling package manager.
For example, if peer deps is specified like "package": ">=1.2.3"
then you will call npm to install deps like:
npm i package@>=1.2.3, that produces stdout redirect to the file =1.2.3

Doesn't work with yarn's workspace

When adding a package to a yarn's workspace-enabled multi packages repository, it fails to add a package because the command needs the -W flag. From my understanding, arguments are not passed through.

To reproduce this bug:

  1. In a new folder, create a package.json with:
    {
    	"private": true,
    	"workspaces": ["packages/*"]
    }
  2. Run yarn
  3. Run install-peerdeps <package> --dev -W -Y

The command fails with:

Running this command will add the dependency to the workspace root rather than workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).

`npm install`uses non-standard `https://registry.npmjs.com` invalidating CLI `npm login`

Details

Passing in the flag --auth will forward to an Authorization header which works for retrieving the package details.

However, if you are relying on an npm login session for the final spawnInstall, the authentication is only recognized for the default https://registry.npmjs.org registry

The following change overrode the system default with an explicit default.
v1.10.2...v1.11.0#diff-910193ee18e1d63616f5f4408fca259bR284

I'm proposing an update that matches the default registry with what's on https://docs.npmjs.com/using-npm/registry.html

Expected

Default registry passed into installPeerDeps should match NPM's default registry of https://registry.npmjs.org

Actual

Default registry passed into installPeerDeps is non-standard https://registry.npmjs.com

regex that checks package name fails if there is a .

When using enzyme-adapter-react-15.4, the . is causing an error in the regex. Changing the regex to the following at least solved this: /^@?([\/\w\.-]+)(@([\d\w\.-]+))?$/

Although, there are additionally concerns in terms of packages names that will continue to break the regex such as scoped packages.

Automatic proxy detection ignores NO_PROXY

While automatic detection of HTTP/S proxy server from standard environment variables is nice, the current implementation is ignoring hosts listed in the NO_PROXY environment variable. This issue manifests when using a private registry specified using the --registry option.

Once I removed my standard set of proxy environment variables, install-peerdeps runs fine.

I would consider using the proxy-from-env package to make this determination easier, and still allow override using the --proxy option.

Custom registry not working?

Hi there,

I tried to install a package from a custom registry, it failed and said package can't be found on npmjs.org, which is not the registry where I commanded it to be.

Any idea what's going on?

image

Support proxy envs

i've got http, https, and ftp proxy envs set both in caps and lower and this times out.

Installing peer dependencies on windows

When running install-peerdeps the install will fail if the packages end in -0.

Version

OS: Windows 7

$ node -v 
v8.11.2

$ npm --version
6.2.0

install-peerdeps v1.8.0

Reproduce

$ install-peerdeps -S enzyme-adapter-react-16

npm ERR! code ETARGET
npm ERR! notarget No matching version found for [email protected]
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

The issue occurs when the install-peerdeps evaluates
e.x.
npm install [email protected] enzyme@^3.0.0 react@^16.0.0-0 react-dom@^16.0.0-0 --no-save
which will fail, but if you place the react and react-dom in quotation marks like:
npm install [email protected] enzyme@^3.0.0 "react@^16.0.0-0" "react-dom@^16.0.0-0" --no-save
it will run successfully.

Not updating package.json when using locally installed version

When I'm using it in the postinstall script (https://github.com/okonet/eslint-config-okonet/blob/master/package.json#L11), the package.json won't updated and I still get npm warnings:

Projects/OSS/attr-accept on ๎‚  fix-eslint-errors [!] is ๐Ÿ“ฆ v via โฌข v8.1.3 took 15s 
โžœ npmD eslint-config-okonet@latest             

> [email protected] postinstall /Users/okonet/Projects/OSS/attr-accept/node_modules/eslint-config-okonet
> install-peerdeps eslint-config-okonet --dev --only-peers

install-peerdeps v1.2.0
Installing peerdeps for [email protected].
npm install babel-eslint@* [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] prettier@* --save-dev

+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
added 237 packages in 14.543s
SUCCESS The peerDeps of eslint-config-okonet were installed successfully.
npm WARN [email protected] requires a peer of babel-eslint@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.

+ [email protected]
added 15 packages, removed 67 packages and updated 1 package in 23.65s

Additionally, when running manually, I see duplicated success message:

install-peerdeps overwrites existing module with an older version

Hi thanks for this package, it's really useful.

I've noticed a (probably obscure) problem with it and just wondering if you have any advice on how to work around it.

First, some background. I'm working on a product called Data-Forge Notebook and it automatically installs npm modules that it finds used in scripts. I found it annoying that npm didn't automatically install peer dependencies. So that lead me to your package.

Here's an example of how I use it. A user of my product includes request-promise as follows:

const request = require('request-promise');

When a user runs this script in Data-Forge Notebook the module is automatically installed for them. This module also has a peer dependency on the request module. I'm made use of install-peerdeps within Data-Forge Notebook to automatically install peer dependencies like this. What it does in this case is run npm install request-promise and then it runs install-peerdeps request-promise --only-peers --silent. This works really well in this case and it ensures that my users automatically have the npm modules they need and also the peer dependencies.

However I discovered a problem with a more complicated use case.

You can easily try this example for yourself to see the result.

Create a new directory and package file:

mkdir test
cd test
npm init -y

Now install Data-Forge:

npm install --save data-forge

This installs the latest version of Data-Forge which is currently 1.3.0.

Now install the Data-Forge add on library data-forge-indicators.

npm install --save data-forge-indicators

data-forge-indicators has a peer dependency of data-forge.

Now run your tool as follows:

npm install -g install-peerdeps
install-peerdeps data-forge-indicators --only-peers --silent

This actually replaces data-forge 1.3.0 with the older version 1.0.10.

data-forge-indicators has a peer dependency on data-forge at or above that version, yet install-peerdeps replaces the existing version with the older version.

I'm thinking that install-peerdeps should be a bit smarter and realise that there is already a new version installed and that it doesn't need to actually do any work.

What do you think? Is this the way install-peerdeps is supposed to work or is this a bug or maybe a use case that hasn't been thought of?

Thanks for your package and your help.

Doesn't work with create-react-app

$ npx install-peerdeps ookook

I created a create-react-app project and tried to use install-peerdeps to install another package, and its peers, to the CRA app.

npx create-react-app foo
cd foo
npx install-peerdeps ookook

I have peerdeps in that file.

What am I doing wrong? :\

Also, I've had problems with understanding how this project works exactly in the past. High level, how is it supposed to work? I would assume it would download a copy of ookook from npm, then look at the package.json of it for a peerDeps field, then loop over those deps running npm/yarn install/add dep.

npx installs "undefined" npm package

Running install-peerdeps (at least via npx on Windows) causes https://www.npmjs.com/package/undefined to be installed as a dependency.

Repro steps

npm init
npx install-peerdeps --dev eslint-config-airbnb

Output:

C:\experiments\install-peerdeps-bug>npx install-peerdeps --dev eslint-config-airbnb
npx: installed 82 in 27.915s
install-peerdeps v1.10.1
Installing peerdeps for eslint-config-airbnb@latest.
npm install [email protected] [email protected] eslint-plugin-import@^2.14.0 eslint-plugin-jsx-a11y@^6.1.1 eslint-plugin-react@^7.11.0 --save-dev

npm WARN deprecated [email protected]: this package has been deprecated
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
added 194 packages from 106 contributors in 62.956s
SUCCESS eslint-config-airbnb
  and its peerDeps were installed successfully.

C:\experiments\install-peerdeps-bug>

Environment

Windows 10
npm v6.4.1
node v10.13.0

Further info

It doesn't do this, when you add the --extraArgs flag.

Installed not all dependencies and version string are different

I made a package with peer deps

"peerDependencies": {
	"@angular/animations": "4.3.6",
	"@angular/common": "4.3.6",
	"@angular/compiler": "4.3.6",
	"@angular/core": "4.3.6",
	"@angular/forms": "4.3.6",
	"@angular/http": "4.3.6",
	"@angular/platform-browser": "4.3.6",
	"@angular/platform-browser-dynamic": "4.3.6",
	"@angular/router": "4.3.6",
	"@progress/kendo-angular-dateinputs": "1.0.6",
	"@progress/kendo-angular-intl": "1.2.2",
	"@progress/kendo-angular-l10n": "1.0.4",
	"@telerik/kendo-intl": "1.2.0",
	"classlist.js": "1.1.20150312",
	"rxjs": "5.4.3"
}

I made a consumer project with only 2 deps:

"dependencies": {
	"@angular/animations": "4.4.1",
	"@valhalla/engine-test": "0.0.7"
},
"devDependencies": {
	"install-peerdeps": "1.4.1"
}

I run
node ./node_modules/install-peerdeps/lib/cli valhalla-engine-test -r https://npm.1forma.ru

And after it package.json of consumer contains:

"dependencies": {
	"@angular/animations": "4.4.1",
	"@progress/kendo-angular-dateinputs": "^1.0.6",
	"@progress/kendo-angular-intl": "^1.3.0",
	"@progress/kendo-angular-l10n": "^1.0.5",
	"@telerik/kendo-intl": "^1.2.0",
	"@valhalla/engine-test": "0.0.7",
	"classlist.js": "^1.1.20150312",
	"valhalla-engine-test": "0.0.2"
},
"devDependencies": {
	"install-peerdeps": "^1.4.1"
}

And the issue:

  1. not all peer dependencies are installed but there is no warnings about it, that is tolerable. Anyway, I prefer to have all deps listed.

  2. version strings are different from original project
    original
    "@progress/kendo-angular-l10n": "1.0.4",
    set by install-peerdeps
    "@progress/kendo-angular-l10n": "^1.0.5"
    next operation with peer npm throws warning
    npm WARN @valhalla/[email protected] requires a peer of @progress/[email protected] but none was installed.

  3. Have no idea why "valhalla-engine-test": "0.0.2" appeared. Not sure is it my fault or not

yarn add error when install install-peerdeps-1.9.0.tgz

error An unexpected error occurred: "http://XXX/install-peerdeps/-/install-peerdeps-1.9.0.tgz: unexpected end of file".
info If you think this is a bug, please open a bug report with the information provided in "/usr/src/app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

We found it impossible to download install-peerdeps-1.9.0.tgz when runing yarn

and this file(install-peerdeps-1.9.0.tgz) can't be decompression

Using a version number range results in a TypeError

I attempted to use a version number range with install-peerdeps and got a TypeError. To reproduce you can do the following:

 install-peerdeps --yarn eslint-plugin-node@^6.x
install-peerdeps v1.6.0
/tool/node_modules/install-peerdeps/lib/helpers.js:34
    packageName = parsed[1];
                        ^

TypeError: Cannot read property '1' of null
    at parsePackageString (/tool/node_modules/install-peerdeps/lib/helpers.js:34:25)
    at Object.<anonymous> (/tool/node_modules/install-peerdeps/lib/cli.js:78:59)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

I was hoping to have a version number resolved based on the constraint as npm and yarn would do.

airbnb-config-eslint no-restricted-syntax parsing error

The package.json on the v14.1.0 tag of eslint-config-airbnb lists the peer dependency eslint@^3.15.0 as the minimum eslint version needed to get the package working, but when that version of eslint is installed with the currently published npm@latest release of the package (v14.1.0) you may get a parsing error with the "no-restricted-syntax" rule.

To fix this error, install eslint 3.19.0 manually using yarn add [email protected] or npm install [email protected].

Cannot install package that is part of a private organization

When attempting to install a package that is part of an npm organization @my-organization/package-name, I'm getting an error that says:

ERR That package doesn't exist. Did you mean to specify a custom registry?

Even after specifying the registry, I get the error.

Wondering if this might have something to do with the way that the package name gets encoded?


Edited To Add: Hmm... the problem may not be with the organization because i was able to use this for @angular/core just fine...

support for [email protected]

it failed to parse the package name when executing install-peerdeps [email protected] and got the error:
C:\Users\Administrator\AppData\Roaming\npm\node_modules\install-peerdeps\lib\cli.js:86
packageName = parsed[1];

Public API

This is great. Thank you.

I would like the API exposed and declared in packages.jsonโ€™s main.

yarn pass through arguments

I saw #24 but I think the functionality in yarn has changed: when I try to run install-peerdeps eslint-config-airbnb -d -Y -W I get Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check). so I know the the -W isn't get passed through.

npx install-peerdeps npm-linked-package fails

Hello there, I ran into a problem when trying to install peerDependencies for a package that is not yet published to the npm registry and that I npm linked locally.

Got the following error: ERR That package doesn't exist. Did you mean to specify a custom registry?

Is there a flag I could use?

Thanks!

[FR] Install peerdeps from local package

Don't know if this isn't already possible, but I'd like to be able to install peerdeps globally from a local package.

I have a local package (eslint-config-sarpik) which I have installed globally (not via linking (should I just use linking?)).

Sometimes I add some peerDependencies & I'd like to be able to install them myself globally prior to publishing.

Being able to do something like npx install-peerdeps --global --yarn ./ would be awesome.

See also #51 for locally linked packages.

Incorrect selection of package version

I have an eslint-config-myconfig package in a private registry having the following peer dependencies:

  "peerDependencies": {
    "@typescript-eslint/eslint-plugin": ">=2.21 <3",
    "@typescript-eslint/parser": ">=2.21 <3",
    "eslint": ">=6.8 <7",
    "eslint-config-airbnb-typescript": ">=7 <8",
    "eslint-config-prettier": ">=6.10 <7",
    "eslint-plugin-import": ">=2.20 <3",
    "eslint-plugin-prettier": ">=3.1 <4",
    "eslint-plugin-security": ">=1.4 <2",
    "prettier": ">=1.19 <2",
    "typescript": ">=3.8 <4"
  },

When I run install-peerdeps, I'm getting a "no matching version" error:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for [email protected].
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

It appears that install-peerdeps is not using the exact same semver expression when issuing the "npm install" command. So, instead of npm install typescript@">=3.8 <4", it's just reading the first literal a.b.c number.

A quick debug shows the command being executed:

Use of .npmrc config

Use .npmrc file to get the registry url

I have a private registry and then I run
install-peerdeps valhalla-engine-test

I get en error
ERR That package doesn't exist. Please try another.

That because global npm server is used instead of one that setup in .npmrc file

Proxy disable strict-ssl

I run:
install-peerdeps --dev eslint-config-airbnb -p http://proxy:8080
But because our certificate on our proxy is old i get error:
ERR Error: unable to get local issuer certificate
I would like to disbale the check on ssl like you can do in npm with:
npm config set strict-ssl false

Support --ignore-scripts flag

This could easily be put in postinstall if support was added for the yarn/npm install --ignore-scripts flag.
Otherwise, postinstall would trigger preinstall/install and cycle.

Use with `postinstall`

I'm trying to use this package to install peerDependencies for my shared config in a config consumer repository using the postinstall script like this: https://github.com/okonet/eslint-config-okonet/pull/4/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R11

but this produces the following error:

โžœ npmD okonet/eslint-config-okonet#install-deps

> [email protected] postinstall /Users/okonet/Projects/OSS/attr-accept/node_modules/eslint-config-okonet
> install-peerdeps eslint-config-okonet --dev

install-peerdeps v1.1.3
Installing peerdeps for [email protected].
npm install eslint-config-okonet [email protected] prettier@* --save-dev

npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "eslint-config-okonet" under a package
npm ERR! also called "eslint-config-okonet". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR! 
npm ERR! For more information, see:
npm ERR!     <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/okonet/.npm/_logs/2017-09-12T17_27_11_114Z-debug.log
ERR The install process exited with error code 1.
npm WARN [email protected] requires a peer of babel-eslint@^7.2.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-config-airbnb@^15.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-config-prettier@^2.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-flowtype@^2.19.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-import@^2.7.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-jsx-a11y@^5.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-node@^5.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-prettier@^2.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-react@^7.3.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `install-peerdeps eslint-config-okonet --dev`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/okonet/.npm/_logs/2017-09-12T17_27_11_762Z-debug.log

I'm not sure why it's trying to install the package itself and if this is by design.

install-peerdeps should handle/pass version ranges with spaces to yarn

Do you want to request a feature or report a bug?

bug

What is the current behavior?

yarn add fails to install packages with version ranges.

yarn add v1.7.0
[1/4] ๐Ÿ”  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/%3C5.0.0: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/Users/nandub/development/chingu/Bears-Team-07/client/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
ERR The install process exited with error code 1.

yarn-error.log

If the current behavior is a bug, please provide the steps to reproduce.

$ install-peerdeps eslint-loader -d
install-peerdeps v1.8.0
It seems as if you are using Yarn. Would you like to use Yarn for the installation? (y/n) Y
Installing peerdeps for eslint-loader@latest.
yarn add [email protected] eslint@>=1.6.0 <5.0.0 webpack@>=2.0.0 <5.0.0 --dev

yarn add v1.7.0
[1/4] ๐Ÿ”  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/%3C5.0.0: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/Users/nandub/development/chingu/Bears-Team-07/client/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
ERR The install process exited with error code 1.

What is the expected behavior?

install-peerdeps should handle/pass version ranges to yarn when installing the packages.

Passing quotes to yarn seems to do the trick:

$ yarn add [email protected] eslint@">=1.6.0 <5.0.0" webpack@">=2.0.0 <5.0.0" --dev
yarn add v1.7.0
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
[3/4] ๐Ÿ”—  Linking dependencies...
[4/4] ๐Ÿ“ƒ  Building fresh packages...
success Saved lockfile.
success Saved 0 new dependencies.
โœจ  Done in 20.81s.

Please mention your node.js, yarn and operating system version.

nodejs=8.11.3
yarn=1.7.0
MacOS=El Capitan (10.11.6)

Why not auto-detect NPM registry from .npmrc?

I see in discussion from #16 that the OP wanted to install dependencies in a package from a private registry, and the subsequent support for that through the --registry option.

My question is, why does install-peerdeps not work alongside npm (or yarn) by using settings that are already set in ~/.npmrc (or ~/.yarnrc), especially with respect to use of a private NPM registry.

For example, I have published eslint-config-myconfig in my private registry, the URL of which I've configured in my ~/.npmrc file. So, if I run this command to query the package's peer dependencies:

$ npm info eslint-config-myconfig peerDependencies --json
{
  "@typescript-eslint/eslint-plugin": ">=2.21 <3",
  "@typescript-eslint/parser": ">=2.21 <3",
  "eslint": ">=6.8 <7",
  "eslint-config-airbnb-typescript": ">=7 <8",
  "eslint-config-prettier": ">=6.10 <7",
  "eslint-plugin-import": ">=2.20 <3",
  "eslint-plugin-prettier": ">=3.1 <4",
  "eslint-plugin-security": ">=1.4 <2",
  "prettier": ">=1.19 <2",
  "typescript": ">=3.8 <4"
}

It just works!

The same should be true when it comes to installing those peer dependencies. When spawning a child process to run npm (or yarn), just let the underlying package manager read its own configuration file.

Yarn promptions quit without any outputs.

> npx install-peerdeps eslint-config-airbnb-base
install-peerdeps v2.0.1
It seems as if you are using Yarn. Would you like to use Yarn for the installation? (y/n) y

Error happened due to the next lines:

install-peerdeps/src/cli.js

Lines 180 to 194 in 0db94a1

confirm(
"It seems as if you are using Yarn. Would you like to use Yarn for the installation? (y/n)",
(err, value) => {
if (err) {
console.log(`${C.errorText} ${err.message}`);
process.exit(1);
}
// Value is true or false; if true, they want to use Yarn
if (value) {
packageManager = C.yarn;
}
// Now install, but with the new packageManager
installPeerDeps({ ...options, packageManager }, installCb);
}
);

promptly.confirm won't accept a callback as the second params in ^3.0.3 any more.
See their docs in https://github.com/moxystudio/node-promptly#confirmmessage-options

ERR spawn npm ENOENT

install-peerdeps eslint-plugin-vuetify

install-peerdeps v3.0.0
ERR spawn npm ENOENT

Always ERR spawn npm ENOENT for every package I try.

Add yarn v2 support

Could you, please, add yarn v2 support.
Command line is the same, except --registry option is not supported.

Global support (npm)

Would be great to have global install support. Alternatively (less preferable), install-peerdeps should not proceed when passed a global flag (since it won't do what you expect).

install-peerdeps tslint -g

results in an:

npm install [email protected] typescript@>=2.9.0-dev --save

when it should perform:

npm install [email protected] typescript@>=2.9.0-dev -g

otherwise the following behavior occurs (on a non-npm project directory):

  1. you get a warning about a package.json not existing followed by warnings about required fields missing from this file
  2. npm creates a package-lock.json file in the current directory and suggests you commit it
  3. packages get installed to a new node_modules directory

worse is what happens on a project directory:

  1. it saves this new requirement to the runtime dependencies of your existing package.json
  2. packages get installed to your local node_modules directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.