Aurelia plus pnpm

Does somebody know if Aurelia 1 supports pnpm?

I tried it and got lots of the following error messages:

ERROR in ./My-Code-Base/App/module.ts
Module not found: Error: Can't resolve 'async' in 'C:\My-Code-Base\App'

I use pnpm on almost all my projects.
Add following to either your project’s local .npmrc, or global .npmrc. Then do a clean pnpm i.

shamefully-hoist=true

“shamefully”…
Is there any plan to make Aurelia 2 work “honorably”?
I heard ESM is going to be supported btw.

That’s pnpm config to be npm compatible, not controlled by us.

I did ask them why not have the default config to hoist so that it’s compatible with npm out of the box. They don’t want to do that, and I don’t understand the decision from the engineering stand of view.

1 Like

Personally I see the point that pnpm does not enable “shamefully-hoist” by default. As far as I understand it’s their ambition that only direct referenced packages can be used in own code:

Therefore the developer is forced to cleanly define the dependencies in his code, rather than relying on dependencies of dependencies. Is it possible that you are missing some dependencies or are there other reasons to use “shamefully-hoist”?

It’s not necessarily the fault of your package but perhaps a sub package that may also create the need for shameless

My argument is npm is the standard, deviation from it only causes confusion and breakage.
@zeway666 is right, it’s not only your code, but other 3rd party libs who requires deep deps.

Without hoisting (flatten node_modules), it means you need to add at least aurelia-framework to your package.json explicitly. Right now, it’s a deep dep loaded by aurelia-bootstrapper which is in your package.json.

I’m surprised. If you do not believe in “no hoisting”, why use pnpm in the first place?

Come on, pnpm sells speed and storage saving. I am sold.

I am pretty sure this is the main reason why people chose pnpm.

Thanks a lot for your feedback. I can live with this “hoisting” workaround.

In my Aurelia 2 test project, “pnpm” seems to be working perfectly without any issue, that is good to know for the future! :slight_smile:

Because I put it in your project’s local npmrc :slight_smile:

Oh, so thank you! :slight_smile:

I just run into the same issue. It would be really great to have full support of pnpm.

As noted above this is not strictly something related to Aurelia. The workaround explained with shameful config shouldn’t take long to fix it though