yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.37k stars 2.72k forks source link

Error during migration from npm to Yarn - Invariant Violation #9025

Open Sulaiman2018 opened 5 months ago

Sulaiman2018 commented 5 months ago

I am currently in the process of migrating from npm to Yarn in my project. However, I have encountered an error during the migration process. The error message is as follows:

error Invariant Violation: expected hoisted manifest for "ngx-translate-multi-http-loader#@angular/common#@angular/core" at invariant (/home/user/.nvm/versions/node/v20.9.0/lib/node_modules/yarn/lib/cli.js:2318:15) at _loop2 (/home/user/.nvm/versions/node/v20.9.0/lib/node_modules/yarn/lib/cli.js:91013:9) at PackageHoister.init (/home/user/.nvm/versions/node/v20.9.0/lib/node_modules/yarn/lib/cli.js:91083:19) at PackageLinker.getFlatHoistedTree (/home/user/.nvm/versions/node/v20.9.0/lib/node_modules/yarn/lib/cli.js:48552:20)

The error occurs during the migration process, specifically when running yarn install. I have followed the steps recommended for migration, including removing node_modules and package-lock.json before running yarn install.

Dependencies: "@angular/common": "^14.2.0", "@angular/core": "^14.2.0", "ngx-translate-multi-http-loader": "^8.0.2",

Node.js Version: v20.9.0 Yarn Version: 1.22.21

Daniel15 commented 1 month ago

Not sure about this error, but if you're migrating to Yarn, you should really migrate to the latest version, not to v1 😃