Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

NPM doesn't install local package dependencies #20835

@mjdease

Description

@mjdease

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?

  1. mkdir test-lib && cd test-lib
  2. npm init -y - Create package
  3. npm install extend --save - Add a dependency
  4. mkdir test-app && cd test-app - (note, this directory could be anywhere, doesn't need to be a child)
  5. npm init -y - Create another package
  6. npm install ../ - This package uses the initial package as a dependency
  7. ls node_modules/ - expected: test-lib extend, actual: test-lib

supporting information:

  • npm -v prints: 6.1.0
  • node -v prints: v9.5.0
  • npm config get registry prints: 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions