yarnpkg

Are yarn and npm interchangeable in practice?

此生再无相见时 提交于 2019-12-03 15:20:11
问题 I have a project with a package.json file and an install bash script that, among other steps, runs npm install . I'm thinking of updating the script so that it runs yarn install if yarn is available (to take advantage of yarn's caching, lockfile, etc), and falls back to npm install otherwise. As far as I can tell, all the packages seem to install and work ok either way. Are yarn and npm interchangeable enough for this to be a viable approach, though? Or are there potential issues that this

How to display yarn globally installed packages?

我与影子孤独终老i 提交于 2019-12-03 11:13:01
问题 I am using MacOs Sierra 10.12.4 and I have installed yarn by brew install yarn and it's version is yarn version v0.23.2 I installed angular-cli , bower and ionic using yarn global add <package-name> Then I use yarn global ls to display globally installed packages and I am expecting to see the above installed packages but yarn gives me this: $ yarn global ls yarn global v0.23.2 warning No license field ✨ Done in 0.99s. Then i check yarn global bin and get path /Users/myusername/.config/yarn

Run yarn in a different path

梦想的初衷 提交于 2019-12-03 09:20:19
Is there a way to specify a working directory for yarn? This would be different then the --modules-folder option. Specifically, I'm trying to run the yarn install command from a location outside of the package location. Similar to -C in git --cwd is what you want. (tested with yarn 1.3.2) You can use --cwd like so yarn --cwd <path> <yarn command> 来源: https://stackoverflow.com/questions/46891622/run-yarn-in-a-different-path

How do I create a React Native project using Yarn?

折月煮酒 提交于 2019-12-03 08:17:11
问题 I am running the following commands in the DOS console on a Windows 7 (64-bit) machine. npm install -g yarn yarn add global react-native yarn add global react-native-cli react-native init sample After running react-native init sample , the console was closed. The error log shows: D:\Mobile>"$basedir/../../Users/pramaswamy/AppData/Local/Yarn/.global/node_modules/.bin/react-native.cmd" "$@" D:\Mobile>exit $? 回答1: I think you're adding global dependencies wrong, and you shouldn't need to install

How do I use multiple npm registries in Yarn?

纵然是瞬间 提交于 2019-12-03 07:18:45
问题 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

sync yarn.lock back into package.json and lock

老子叫甜甜 提交于 2019-12-03 06:29:58
I have package.json and yarn.lock files. yarn.lock has versions locked in, I would like to sync, and lock(without the ^) all the versions in yarn.lock, back into package.json. is there any easy way to do that? in the end I would like to not have "^" in my package.json at all as it leads to too many troubles, and I would like to upgrade packages specificly and not unknowingly when I run a fresh yarn install. is there any tool or way to quickly replace the versions in package.json with those exsisting inside yarn.lock? I ended up making something myself: sync-yarnlock-into-packagejson its a tiny

Incorrect integrity when fetching from the cache

烂漫一生 提交于 2019-12-03 06:28:17
问题 When running yarn add --dev jest , I got error Incorrect integrity when fetching from the cache . Full output: tests (master)$ yarn add --dev jest yarn add v1.19.0 info No lockfile found. [1/4] Resolving packages... warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart() [2/4] Fetching packages... error Incorrect integrity when fetching from the cache info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this

Customize AWS ElasticBeanstalk NodeJS Install (use yarn)

[亡魂溺海] 提交于 2019-12-03 05:36:19
问题 Isit possible to configure EBS to install my NodeJS application using yarn package manager instead of NPM? 回答1: I've figured out a way, but it is a little hacky. Create a .ebextensions/yarn.config file. (The name does not have to be 'yarn'.) Put this content into the file: files: # Runs right before `npm install` in '.../50npm.sh' "/opt/elasticbeanstalk/hooks/appdeploy/pre/49yarn.sh" : mode: "000775" owner: root group: users content: | #!/bin/bash app="$(/opt/elasticbeanstalk/bin/get-config

How to display yarn globally installed packages?

梦想与她 提交于 2019-12-03 05:07:07
I am using MacOs Sierra 10.12.4 and I have installed yarn by brew install yarn and it's version is yarn version v0.23.2 I installed angular-cli , bower and ionic using yarn global add <package-name> Then I use yarn global ls to display globally installed packages and I am expecting to see the above installed packages but yarn gives me this: $ yarn global ls yarn global v0.23.2 warning No license field ✨ Done in 0.99s. Then i check yarn global bin and get path /Users/myusername/.config/yarn/bin and I go to the directory and see softlinks: lrwxr-xr-x 1 myusername staff 38B 19 Apr 10:17 bower ->

Are yarn and npm interchangeable in practice?

别等时光非礼了梦想. 提交于 2019-12-03 05:02:29
I have a project with a package.json file and an install bash script that, among other steps, runs npm install . I'm thinking of updating the script so that it runs yarn install if yarn is available (to take advantage of yarn's caching, lockfile, etc), and falls back to npm install otherwise. As far as I can tell, all the packages seem to install and work ok either way. Are yarn and npm interchangeable enough for this to be a viable approach, though? Or are there potential issues that this could lead to? Are we meant to just pick one, or is yarn interchangeable with npm in practice? (nb. I've