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

node_modules/__ngcc_entry_points__.json causes issues with pnpm install #38023

Closed
leonard84 opened this issue Jul 13, 2020 · 5 comments
Closed

Comments

@leonard84
Copy link

leonard84 commented Jul 13, 2020

🐞 bug report

Affected Package

The issue is caused by package @angular/....

"@angular/compiler": "^10.0.3"

Is this a regression?

Yes, the previous version in which this bug was not present was: Angular 8. I didn't try Angular 9.

It worked before __ngcc_entry_points__.json was added to node_modules so I'd say yes.

Description

Under some circumstances Angulars ngcc create a file node_modules/__ngcc_entry_points__.json, this file conflicts with the package manager pnpm.

🔬 Minimal Reproduction

You need to have pnpm installed as package manager.

  1. Run ng new --package-manager pnpm test-issue
  2. As I couldn't find a way to get the node_modules/__ngcc_entry_points__.json generated in this test project, simply put this sample __ngcc_entry_points__.json into node_modules
    ngcc_entry_points.zip
  3. Run pnpm install

🔥 Exception or Error


 ERROR  "./test-issue/node_modules/__ngcc_entry_points__.json" is not a directory
at tryReadProjectManifest     ../../../../../../../AppData/Roaming/npm/node_modules/pnpm/lib/node_modules/@pnpm/read-project-manifest/lib/index.js:89  const err = new Error(`"…
at async readProjectManifest  ../../../../../../../AppData/Roaming/npm/node_modules/pnpm/lib/node_modules/@pnpm/read-project-manifest/lib/index.js:17  const result = await try…
at readProjectManifestOnly    ../../../../../../../AppData/Roaming/npm/node_modules/pnpm/lib/node_modules/@pnpm/read-project-manifest/lib/index.js:25  const { manifest } = awa…
at async safeReadProjectMan…  ../../../../../../../AppData/Roaming/npm/node_modules/pnpm/lib/node_modules/@pnpm/link-bins/lib/index.js:126             return await read_projec…
at async getPackageBins       ../../../../../../../AppData/Roaming/npm/node_modules/pnpm/lib/node_modules/@pnpm/link-bins/lib/index.js:76              ? await safeReadProjectM…
at all
at default                    ../../../../../../../AppData/Roaming/npm/node_modules/pnpm/lib/node_modules/@pnpm/link-bins/lib/index.js:30              const allCmds = R.unnest…
at all
at default                    ../../../../../../../AppData/Roaming/npm/node_modules/pnpm/lib/node_modules/@pnpm/headless/lib/index.js:210              await Promise.all(opts.p…
at async _install             ../../../../../../../AppData/Roaming/npm/node_modules/pnpm/lib/node_modules/supi/lib/install/index.js:97                 await headless_1.default…

🌍 Your Environment

Angular Version:
There seems to be an issue with the version detection when pnpm is used

Angular CLI: 10.0.1
Node: 14.4.0
OS: win32 x64

Angular: 10.0.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       <error>
@angular-devkit/build-angular   0.1000.1
@angular-devkit/core            <error>
@angular-devkit/schematics      <error>
@angular/cli                    10.0.1
@schematics/angular             <error>
@schematics/update              <error>
rxjs                            6.5.5
typescript                      3.9.6

Anything else relevant?
no

@sonukapoor sonukapoor added the area: compiler Issues related to `ngc`, Angular's template compiler label Jul 13, 2020
@ngbot ngbot bot added this to the needsTriage milestone Jul 13, 2020
@JoostK JoostK added comp: ngcc and removed area: compiler Issues related to `ngc`, Angular's template compiler labels Jul 13, 2020
@JoostK
Copy link
Member

JoostK commented Jul 13, 2020

Using pnpm is generally not supported, please see #32087 (comment) for details. So even if pnpm would not error because of the manifest file, it may still not work. We're not actively testing with pnpm and ngcc's model is not really compatible with the way pnpm operates.

@leonard84
Copy link
Author

leonard84 commented Jul 14, 2020

That is unfortunate, the scarce documentation regarding package managers suggests otherwise. Maybe you could print out a Warning/Error when pnpm and ivy are active.

The funny thing is, it seems to work fine, when I delete this json file I can install new modules if needed, and ng build runs without problems, So if I understand it correctly it then modifies the symlinked packages in node_modules/.pnpm?

@ngbot ngbot bot modified the milestones: needsTriage, Backlog Jul 21, 2020
@radarsu
Copy link

radarsu commented Jul 29, 2020

pnpm assumes node_modules contains only directories. I believe this assumption is correct.

ngcc compiler adds ngcc_entry_points.json to node_modules directly. I believe that file should be generated under some dot-directory (like .angular, .ng or .ngcc) and not bloating node_modules with json file.

@petebacondarwin
Copy link
Member

This should be solved by the ng-linker being developed to replace ngcc. Please follow along with the progress here: https://github.com/orgs/angular/projects/2

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants