Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

Generated node_modules incompatible with integrity check #107

Open
rprije opened this issue Jul 4, 2019 · 0 comments
Open

Generated node_modules incompatible with integrity check #107

rprije opened this issue Jul 4, 2019 · 0 comments

Comments

@rprije
Copy link

rprije commented Jul 4, 2019

I have a rails app I'm using mkYarnPackage with. mkYarnPackage calls mkYarnModules. mkYarnModules uses workspaceJSON to create a package.json for a workspace to put everything under. This results in a node_modules with a .yarn.integrity file with an added dependency on my project (the project is copied into deps, and the generated project.yaml sets up a workspaces using everything under deps). That project.yaml is discarded during the installPhase so the generated node_modules' .yarn.integrity is for a project.yaml with an added dependency to the project itself and that project.yaml no longer exists. Now when I try to link in the node_modules, yarn check --integrity fails with:

$ yarn check --integrity --ignore-scripts
yarn check v1.16.0
warning Integrity check: Top level patterns don't match
error Integrity check failed
error Found 1 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

Comparing the generated .yarn.integrity file with one created by a direct yarn install confirms that the difference is the addition of the project i tself to topLevelPatterns.

It seems node_modules is generated in a way so as to be incompatible with integrity checks. Is there a way to use it in a way compatible with integrity checks?

As an aside, the use of --ignore-scripts also causes the flag to be added to .yarn.integrity and the integrity check to fail unless --ignore-scripts is also added to yarn check as above:

$ yarn check --integrity
yarn check v1.16.0
warning Integrity check: Flags don't match
error Integrity check failed
error Found 1 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant