Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every module in package-lock.json generated by synp has empty "requires" field which result in running failure because of module loss #100

Open
zhouyuyuyuu opened this issue May 31, 2023 · 0 comments

Comments

@zhouyuyuyuu
Copy link

Issue description:

Background: I got an existed project which use yarn.lock and I want to convert yarn.lock to package.lock.

Steps:

  1. I run yarn install , generate node_modules.
  2. run synp --source-file yarn.lock just like the doc says. Generate package-lock.json successfully.
  3. run npm install. Got some "Cannot find module ..." error in the middle, and "remove 1842 packages... " info at the end. And, lots of dependencies in package-lock.json has been removed after running npm install!
  4. run npm run serve. Failed in error "Error: Cannot find module... "

Result: So, I converted yarn.lock to package-lock.json successfully and conveniently, but this package-lock.json cannot install module properly and of course I can't run this project using this package-lock.json.

What I found: I removed node_modules and package-lock.json and retry Step1 and 2. Find out that every module in new generated package-lock.json has empty "requires" field. I think that will result in lots of first level indirect dependency package in package-lock lose connection to other package and seems like they are dependencies of nothing. The package-lock.json whose content been cut a lot after Step3 can prove it .

Are you reporting a conversion error? Please include a link to yarn.lock / package-lock.json:

https://github.com/zhouyuyuyuu/temp/blob/main/yarn.lock

Are you reporting a conversion error? Please also include a link to your package.json:

https://github.com/zhouyuyuyuu/temp/blob/main/package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant