question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tracking: Third party NPM replacements

See original GitHub issue

In the recent weeks, multiple have requested support for the following two NPM replacements:

  • yarn, which has a lot of speed improvements. Many users reported problems using yarn with the CLI in some occasions.
  • cnpm, which uses an NPM cache specially made for China. It’s not useful for anyone outside of China itself.

What I suggest is embracing the fact that users can have an angular-cli.json file in their home folder to specify which NPM replacement they want to use.

Something like adding to the configuration:

{ // ...
  "packageManager": "npm"  // or "cnpm" or "yarn"
}

And having special code for some of them when the user creates a new package.

I think this is the cleanest way to do it. If we document it well, users won’t have a problem. They can even replace its value per-project.

cc @IgorMinar

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
hanslcommented, Jan 11, 2017

Discussing this more with @IgorMinar, we came to the point where the following would be acceptable:

  • On ng new, if we detect either yarn or cnpm, we output a warning message to users, telling them they can ng set --global packageManager=yarn to use it globally with new projects.
  • Users can then set it globally and recreate the project, or yarn install locally instead.

NPM is only used when running init and new, and since init is used by new we should just put the warning on init.

5reactions
sivabudhcommented, Mar 18, 2017

TL;DR:

ng set --global packageManager=yarn
ng new <your-app-name>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Top 10 npm Alternatives & Competitors - G2
Top 10 Alternatives to npm · NuGet · Ninite · Nexus Repository Manager · JFrog Artifactory · Github Package Registry · Helix Core...
Read more >
List of Best SolarWinds NPM Alternatives & Competitors 2022
Best SolarWinds NPM Alternatives for Medium-sized Companies · Nmap · Intermapper · NinjaOne · ThousandEyes · Auvik · LogicMonitor · Icinga · PRTG....
Read more >
JavaScript package managers compared: npm, Yarn, or pnpm?
It is a drop-in replacement for npm, so if you have an npm project, ... often a third-party command can be used, via...
Read more >
Replacing Real Dependencies with Test Doubles - GitHub
Even though testdouble.js does support replacing third-party npm modules, it is not recommended unless you own the module! Typically, when practicing the ...
Read more >
react-tracking - npm
Declarative tracking for React apps.. Latest version: 9.3.0, last published: 7 days ago. Start using react-tracking in your project by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found