yarnpkg

Migrating from bower to yarn

梦想与她 提交于 2019-12-08 03:15:24
问题 Since bower package manager is deprecated now, I am finding a way to migrate my bower.json to "Yarn" without having to enter packages manually, or break dependencies. Is there any script or utility to do the migration? 回答1: I've written one: https://bower.io/blog/2017/how-to-migrate-away-from-bower/ Hope it helps 回答2: For me running bower-away was enough. It took a while and some iterations until it finished, but was just follow the instructions. As stated in the utility page just run the

Use enviroment variables in yarn package.json

只愿长相守 提交于 2019-12-07 16:14:14
问题 I want to pull from a private package hosted on bitbucket. Since SSH is not an option for my deploy setup, I want to access the repo using the Application Password. So my entry in the package JSON looks like this: "dependencies": { "@companyName/repository": "git+https://${$BITBUCKET_USER}:${BITBUCKET_APP_PASSWORD}@bitbucket.org/company name/repository.git", Coding username and password hard into the repo URL works fine but when I perform yarn install as above, the environment variables are

AWS CodeBuild does not work with Yarn Workspaces

本小妞迷上赌 提交于 2019-12-07 14:45:52
问题 I'm using Yarn Workspaces in my repository and also using AWS CodeBuild to build my packages. When build starts, CodeBuild takes 60 seconds to install all packages and I'd want to avoid this time caching node_modules folder. When I add: cache: paths: - 'node_modules/**/*' to my buildspec file and enable LOCAL_CUSTOM_CACHE , I receive this error: error An unexpected error occurred: "EEXIST: file already exists, mkdir '/codebuild/output/src637134264/src/git-codecommit.us-east-2.amazonaws.com/v1

Hadoop YARN vs Yarn package manager command conflict

房东的猫 提交于 2019-12-07 13:19:05
问题 I'm having an issue with the yarn command on my machine. I have both hadoop and yarn package manager (Javascript) installed on my machine. When I run yarn init it calls hadoop's YARN and responds with : Error: Could not find or load main class path/to/folder Can anyone please tell me how to separate the two commands. I am using a 64-bit windows 10 machine. 回答1: Turns out you can just use yarnpkg instead of yarn 来源: https://stackoverflow.com/questions/44739402/hadoop-yarn-vs-yarn-package

Tags may not have any characters that encodeURIComponent encodes

帅比萌擦擦* 提交于 2019-12-07 11:40:46
问题 I'm migrating from bower to yarn, and in my bower.json file I have this dependency: Snap.svg": "snap.svg#^0.4.1 When I tried to do the same in the yarn dependencies file, I got this error : npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name "snap.svg@^0.4.1": Tags may not have any characters that encodeURIComponent encodes. How can I solve this ? 回答1: Two things: First, the npm package name -- which yarn uses since it uses package.json -- is snapsvg whereas snap.svg (with a dot) is only

Passing Redux store in props

半腔热情 提交于 2019-12-07 05:56:42
问题 I'm doing an University practice building an app using React and Redux. When I start the server using Yarn, I get this error: Passing redux store in props has been removed and does not do anything. To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React-Redux's Provider and specific components like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. You may also pass a

Can Yarn and npm be used by multiple developers on the same project?

▼魔方 西西 提交于 2019-12-07 02:32:09
问题 I work in a team of about 20 other developers. All of our projects utilize npm packages and currently all of our developers are running npm to manage those packages. I'm very curious about Yarn and have it currently installed on my machine. However I'm nervous to actually use it to install packages in case it screws up a project for other developers. My question is can one developer utilize Yarn on a project while other devs are using npm in the same repo? From what I've read, Yarn uses the

How do I set a custom cache path for Yarn?

廉价感情. 提交于 2019-12-07 00:02:23
问题 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. 回答1: The actual command is: yarn config set cache-folder /usr/local/Caches/yarn

Jest doesn't run — hangs indefinitely

不想你离开。 提交于 2019-12-06 16:40:16
I was originally having this problem with create-react-app, so I did really bare bones setup just of jest: created new directory yarn init in that directory yarn add jest created new file sum.js: function sum(a, b) { return a + b; } module.exports = sum; created file to test above function const sum = require('./sum'); test('adds 1 + 2 = 3' , () => { expect(sum(1,2)).toBe(3); }); added to package.json: "scripts": { "test": "jest" }, But when I run yarn test, I get this: terry@terry-sharewalker:~/myProjects/test-jest$ yarn jest yarn run v1.13.0 $ /home/terry/myProjects/test-jest/node_modules/

Migrating from bower to yarn

与世无争的帅哥 提交于 2019-12-06 11:39:22
Since bower package manager is deprecated now , I am finding a way to migrate my bower.json to "Yarn" without having to enter packages manually, or break dependencies. Is there any script or utility to do the migration? I've written one: https://bower.io/blog/2017/how-to-migrate-away-from-bower/ Hope it helps For me running bower-away was enough. It took a while and some iterations until it finished, but was just follow the instructions. As stated in the utility page just run the following commands: yarn global add bower-away # or "npm install -g bower-away" bower-away # listen and repeat!