-
Notifications
You must be signed in to change notification settings - Fork 3k
NPM doesn't install local package dependencies #20835
Description
I'm opening this issue because:
- npm is crashing.
- npm is producing an incorrect install.
- npm is doing something I don't understand.
- npm is producing incorrect or undesirable behavior.
- Other (see below for feature requests):
What's going wrong?
NPM is not installing dependencies of local (ie npm install ../) packages.
This is effectively a resubmission of #13734.
My use case is I'm locally developing a library and example apps that use this library.
Currently it's possible for the library package to have incorrectly configured dependencies (eg devDependencies that should actually be dependencies) but the example apps still build fine because the dependency is present within dev setup of the library package. I want the build to fail because the dependency would not be available in the published package.
Configuring Webpack to only resolve the local node_modules directory (via resolve.modules) works to expose the problem but there doesn't seem to be a way with NPM to actually get the dependencies of a local dependency to be installed in the current package.
How can the CLI team reproduce the problem?
mkdir test-lib && cd test-libnpm init -y- Create packagenpm install extend --save- Add a dependencymkdir test-app && cd test-app- (note, this directory could be anywhere, doesn't need to be a child)npm init -y- Create another packagenpm install ../- This package uses the initial package as a dependencyls node_modules/- expected:test-libextend, actual:test-lib
supporting information:
npm -vprints: 6.1.0node -vprints: v9.5.0npm config get registryprints: https://registry.npmjs.org/- Windows, OS X/macOS, or Linux?: macOS
- Network issues:
- Geographic location where npm was run:
- I use a proxy to connect to the npm registry.
- I use a proxy to connect to the web.
- I use a proxy when downloading Git repos.
- I access the npm registry via a VPN
- I don't use a proxy, but have limited or unreliable internet access.
- Container:
- I develop using Vagrant on Windows.
- I develop using Vagrant on OS X or Linux.
- I develop / deploy using Docker.
- I deploy to a PaaS (Triton, Heroku).