yarnpkg

How to install package from github repo in Yarn

有些话、适合烂在心里 提交于 2019-12-03 02:32:52
问题 When I use npm install fancyapps/fancybox#v2.6.1 --save , so fancybox package at v2.6.1 tag will be installed. This behavior is described in docs I want to ask, how to do this with yarn ? Is this command the right alternative? In yarn docs isn't anything about this format. yarn add fancyapps/fancybox#v2.6.1 回答1: You can add any Git repository (or tarball) as a dependency to yarn by specifying the remote URL (either HTTPS or SSH): yarn add <git remote url> installs a package from a remote git

How do I use multiple npm registries in Yarn?

非 Y 不嫁゛ 提交于 2019-12-02 22:03:00
I'm trying to setup Yarn 0.17.9 in our environment but I have a problem with our registry. We are currently using two registries, official npmjs and our own registry on internal network (Sinopia). The problem is that we are using internal tool to pull packages from one or the other with --registry flag via npm install . yarn add doesn't have --registry option and I'm unable to set the custom registry globally with fallback to npmjs. I tried .npmrc but it sets only one registry for npm/yarn in project. .yarnrc doesn't seem to work and is silenced by .npmrc Is there any way to specify two

How to upgrade yarn version using terminal?

江枫思渺然 提交于 2019-12-02 19:53:28
How should yarn be upgraded to the latest version? For macOS users, if you installed yarn via brew , you can upgrade it using the below command: brew upgrade yarn Abdul Rahman npm install --global yarn npm upgrade --global yarn This should work. Try and let me know if its not working. On Linux, just run below command at terminal: $ curl --compressed -o- -L https://yarnpkg.com/install.sh | bash After do this, close the current terminal and open it again. And then, run below command to check yarn current version: $ yarn --version Not remembering how i've installed yarn the command that worked

How to install package with local path by Yarn? It couldn't find package

心已入冬 提交于 2019-12-02 17:02:33
In my package.json I'm pointing local package my-custom-i18n by its relative path: package.json "dependencies": { "core-js": "^2.4.1", "my-custom-i18n": "./../MyProject.Shared/myproject-i18n", "rxjs": "5.0.0-beta.12", ... } npm install installs packages correctly, but yarn has problem with it and simply cannot find this package: yarn output $ yarn yarn install v0.15.1 info No lockfile found. [1/4] Resolving packages... error Couldn't find package "myproject-i18n" on the "npm" registry. info Visit http://yarnpkg.com/en/docs/cli/install for documentation about this command. I see that it looks

How to install package from github repo in Yarn

拥有回忆 提交于 2019-12-02 14:33:48
When I use npm install fancyapps/fancybox#v2.6.1 --save , so fancybox package at v2.6.1 tag will be installed. This behavior is described in docs I want to ask, how to do this with yarn ? Is this command the right alternative? In yarn docs isn't anything about this format. yarn add fancyapps/fancybox#v2.6.1 Kasiriveni You can add any Git repository (or tarball) as a dependency to yarn by specifying the remote URL (either HTTPS or SSH): yarn add <git remote url> installs a package from a remote git repository. yarn add <git remote url>#<branch/commit/tag> installs a package from a remote git

When to use Yarn over NPM? What are the differences?

泄露秘密 提交于 2019-12-02 14:25:48
What are the differences between Yarn and NPM? At the time of writing this question I can only find some articles on the Internet showing what's the Yarn equvalent of an NPM command like this . Do they have the same functionalities (I know Yarn does local caching and looks like you only need to download a package once) but other than this is there any benefits for moving from NPM to Yarn? UPDATE: March 2018 (bit late...) Since version 5, npm generates a 'lockfile' called package-lock.json that fixes your entire dependency tree much the same way the yarn (or any other) locking mechanism does, A

How to use yarn in ASP.Net core MVC to install bootstrap in wwwroot folder

守給你的承諾、 提交于 2019-12-02 04:26:11
recently I started learning ASP.Net core MVC. I always used bower to install packages for my projects in Visual Studio 2017. but now I want to use yarn. since it seems bower is deprecated. but I don't know how to use yarn to install bootstarp in wwwroot folder. for bower i used bower.json and it would install bootstarp automatically. I use "yarn add bootstrap@4.0.0-alpha.6 --dev" but it install it in node_modules in the project folder and I can't see it in the solution explorer, thanks It's best to use npm(a package manager) for Asp.net core application,start by searching and adding a package

Difference between yarn/npm5 lockfiles and exact package versions?

江枫思渺然 提交于 2019-12-01 18:10:43
My simple question is: why can't I just use exact versions in my package.json? How is this different from a lockfile? The main difference is that lockfiles also lock nested dependencies - all of the dependencies of your dependencies, and so on. Managing and tracking all of those changes can be incredibly difficult, and the number of packages that are used can grow exponentially. There are also situations where you cannot manually specify that a particular version of a package should be used - consider 2 libraries that specify foo at ~1.0.0 and ~2.0.0 respectively. The difference in major

How do I set a custom cache path for Yarn?

♀尐吖头ヾ 提交于 2019-12-01 17:06:00
I just installed Yarn and I'm trying to switch from npm. I tried to set my cache path like this, but it wasn't successful: yarn --cache-folder /usr/local/Caches/yarn yarn global --cache-folder /usr/local/Caches/yarn yarn global cache --cache-folder /usr/local/Caches/yarn yarn cache --cache-folder /usr/local/Caches/yarn yarn config set --cache-folder /usr/local/Caches/yarn Here is the documentation for yarn config . The actual command is: yarn config set cache-folder /usr/local/Caches/yarn (Note: no preceeding -- ) The docs for yarn cache show the various ways this can be set. 来源: https:/

“error TS2694: Namespace 'angular' has no exported member 'xxx'” after upgrading @types/angular

这一生的挚爱 提交于 2019-12-01 06:41:44
After upgrading angular and @types/angular version to version 1.6.x I have lots of TS2694 errors: error TS2694: Namespace 'angular' has no exported member 'material' error TS2694: Namespace 'angular' has no exported member 'ui' error TS2694: Namespace 'angular' has no exported member 'translate' This worked fine before changing the version number. What could cause the issue? The problem was related to several angular type definitions in my node_modules. Angular types were defined in node_modules/@types/angular and in node_modules/@types/ng-file-upload/node_modules/@types/angular . This was due