I'm trying to build a repository/package for my personal ESLint config files. I have all of my configuration files built the way I would like, and now I am trying to install this package to test it.
In this scenario, I have two packages:
@me/eslint-configis the package containing my ESLint config files.test-packageis the package on/in which I am trying to install@me/eslint-config.
When I try to install the @me/eslint-config package, peer dependencies are not installed, nor are they even mentioned during the installation.
Both packages currently only reside locally on my machine, side-by-side, in the same directory:
<parent_dir>:
- eslint-config
- package.json
- ...
- test-package
- package.json
- ...
The package.json file for @me/eslint-config looks as follows:
{
...
"dependencies": {
"@typescript-eslint/parser": "5.29.0"
},
"peerDependencies": {
"eslint": "8.18.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jsdoc": "39.3.3",
"eslint-plugin-prefer-arrow": "1.2.3",
"@typescript-eslint/eslint-plugin": "5.29.0"
}
...
}
I am installing this package in test-package as follows:
$> cd /path/to/test-package
$> npm i ../eslint-config --save-dev
NPM properly installs all other dependencies, including the @me/eslint-config package itself, but does not install the peerDependencies of @me/eslint-config.
This is using NPM v8.1.0.
This article seems to suggest that NPM >7 installs peer dependencies automatically. This is obviously not working for me.
Things I have already tried that have not fixed the problem:
- Deleting
node_modules/andpackage-lock.jsonfromtest-packageand reinstalling everything. - Pinning all
peerDependenciesversions in@me/eslint-config. - Adding all
peerDependenciesin@me/eslint-configas bothdependenciesandpeerDependenciesin@me/eslint-config.
tl;dr NPM isn't installing peerDependencies