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

Curiosity: use pnpm with some CLI (Ionic, Angular, ...) #767

Closed
maxdevjs opened this issue May 12, 2017 · 13 comments
Closed

Curiosity: use pnpm with some CLI (Ionic, Angular, ...) #767

maxdevjs opened this issue May 12, 2017 · 13 comments

Comments

@maxdevjs
Copy link

This is an awesome project and I wonder if there would be an easy enough solution to use pnpm with Angular / Ionic / ... CLIs

@zkochan
Copy link
Member

zkochan commented May 12, 2017

Currently only by removing the generated node_modules folder and re-running installation with pnpm.

I don't think rewriting the npm command would be fair.

@maxdevjs
Copy link
Author

I see.

The point is that we could install further packages with such CLIs after removing the generated node_modules folder and re-running installation with pnpm.

@zkochan
Copy link
Member

zkochan commented May 12, 2017

I know one tool that allows changing the package manager via an env variable: https://github.com/dylang/npm-check#update-using-ied-or-pnpm

I think that is the right way to do it. Would angular/ionic make it configurable? I don't know, maybe they already allow yarn? Maybe they would add pnpm in that case... Or maybe we have to become more popular.

In worst case someone can fork angular and substitute npm with pnpm, I would add a link to such a fork to the pnpm README.

@maxdevjs
Copy link
Author

maxdevjs commented May 13, 2017

Thank you for your help.

angular-cli offers a -native- configuration alternative for the package manager (currently not working with a couple issues because pnpm is not listed as valid package manager). I do not know yet about Ionic.

I did open an issue specific to the support for pnpm in angular-cli where I give more details about where I am stuck.

npm-check is a great tool, I am checking it.

@zkochan
Copy link
Member

zkochan commented Feb 10, 2018

As of now, pnpm@1.32.0 works with Angular. Does it work with Ionic?

@nakah
Copy link

nakah commented Jun 11, 2018

Hello,
I'm trying to switch an existing Angular 6 application from npm to pnpm but I'm facing errors.
I've deleted existing node_modules folder then run "pnpm install". The node_modules has been created but when I run "ng build" or "ng serve" I have the following errors:
Versions of @angular/compiler-cli and typescript could not be determined.

The most common reason for this is a broken npm install.
Please make sure your package.json contains both @angular/compiler-cli and typescript in
devDependencies, then delete node_modules and package-lock.json (if you have one) and
run npm install again.

Any idea ?

@zkochan
Copy link
Member

zkochan commented Jun 11, 2018

Do you have a sample repo?

You can try rm -rf node_modules && pnpm i --shamefully-flatten

@nakah
Copy link

nakah commented Jun 11, 2018

Thanks! It's a little bit better but still got errors:

Error: ENOENT: no such file or directory, open '\node_modules.registry.npmjs.org\package.json'
at Object.fs.openSync (fs.js:579:3)
at Object.fs.readFileSync (fs.js:485:33)
at LicenseExtractor.readPackageJson (\node_modules.registry.npmjs.org\license-webpack-plugin\1.3.1\webpack-sources@1.1.0\node_modules\license-webpack-plugin\dist\LicenseExtractor.js:126:23)
at LicenseExtractor.parsePackage (\node_modules.registry.npmjs.org\license-webpack-plugin\1.3.1\webpack-sources@1.1.0\node_modules\license-webpack-plugin\dist\LicenseExtractor.js:23:32)

I forgot to mention that I'm on Windows 10.

@zkochan
Copy link
Member

zkochan commented Jun 11, 2018

Seems like an issue with license-webpack-plugin. It might have a broken resolver

@binarious
Copy link

Any workarounds?

@zkochan
Copy link
Member

zkochan commented Jul 5, 2018

Not really. license-webpack-plugin has to fix its resolver. If it would resolve dependencies correctly (not preserving symlinks) then it would work with pnpm's node_modules structure. Feel free to create an issue there and reference me

@binarious
Copy link

Also created #1260, because there are other problems without using --shamefully-flatten.

@zkochan
Copy link
Member

zkochan commented May 7, 2022

If there are still issues, please set the node-linker=hoisted setting, remove node_modules, and reinstall.

@zkochan zkochan closed this as completed May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants