Skip to content

NPM5 generate package-lock from existing node_modules? (migrating from Yarn, using @types) #672

@dwasyluk

Description

@dwasyluk

We're migrating a project from using Yarn for deterministic dependency locking back to pure NPM now that lockfiles are supported in a more deterministic manner. Is there a way to generate package-lock.json from an existing node_modules? npm install which auto-gens the lockfile is pulling down new versions which the existing Yarn.lock file prevents, but I can't find any good material on how to migrate back to pure npm while maintaining the locked versions.

I was thinking using npm shrinkwrap would do it but I ran into npm/npm#16812; installed canary and now npmc shrinkwrap generates a file without errors but none of the @types entries are present (listed under devDependencies in package.json). How can I generate a complete package-lock.json with all @types etc?

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