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.

package dependencies go missing when updatingΒ #17639

@SomeHats

Description

@SomeHats

Thank you for npm πŸ’œβœ¨
I noticed this with 5.0.x and found it was still an issue in 5.1.0 so thought I'd let you know :)

I'm opening this issue because:

  • npm is producing an incorrect install.

What's going wrong?

next@2 depends on webpack 2. next@3 depends on webpack 3.

With my project on next@2, I can run npm ls webpack and get:

[email protected] /Users/somehats/Projects/tmp
└─┬ [email protected]
  └── [email protected]

I can also successfully run next build.

If I run npm i next@beta, I get:

> [email protected] postinstall /Users/somehats/Projects/tmp/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js

npm WARN [email protected] requires a peer of webpack@^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3.0.0 but none was installed.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 56 packages, removed 105 packages, updated 1 package and moved 7 packages in 10.159s

Now, running npm ls webpack gives:

[email protected] /Users/somehats/Projects/tmp
└── (empty)

and next build fails as it can't find webpack.

The only thing that seems to fix things is rm -rf node_modules package-lock.json && npm i. After that, npm ls webpack gives:

[email protected] /Users/somehats/Projects/tmp
└─┬ [email protected]
  └── [email protected]

and next build runs successfully.

How can the CLI team reproduce the problem?

Start with this package.json:

{
  "name": "tmp",
  "version": "1.0.0",
  "dependencies": {
    "next": "2",
    "react": "^15.6.1",
    "react-dom": "^15.6.1"
  }
}

Run npm i. npm ls webpack should show webpack as above. Run npm i next@beta. Now npm ls webpack should give 'empty'.

supporting information:

  • npm -v prints: 5.1.0
  • node -v prints: v8.1.2
  • 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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions