yarnpkg

Why is the reference for a package to be installed from a pull request different for Yarn and original NPM client?

喜夏-厌秋 提交于 2019-12-24 00:48:21
问题 As discussed here the way we identify a PR from which to install a Node.js package is different when using Yarn client and different when using original NPM command line client, e.g.: npm install json-schema-faker/json-schema-faker#pull/129/head and yarn add json-schema-faker/json-schema-faker#129/head Note that in Yarn's case there is no pull/ segment in the package identifier. Trying it other way around results in the following: $ npm install json-schema-faker/json-schema-faker#129/head npm

How do I upgrade all scoped packages with Yarn?

狂风中的少年 提交于 2019-12-23 15:43:38
问题 Is it possible to upgrade all specific scoped packages in the dependencies section of my package.json by using the Yarn package manager? For example: yarn upgrade @scope/* This will upgrade all scoped packages in yarn.lock and package.json file. 回答1: Since there's no way to do this currently with Yarn, I've written a very short Node script to do what you want: var fs = require('fs'); var child_process = require('child_process'); var filterRegex = /@angular\/.*/; fs.readFile('./package.json',

Jest doesn't run — hangs indefinitely

北慕城南 提交于 2019-12-23 03:08:08
问题 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

Rails asset pipeline working with fonts and yarn

徘徊边缘 提交于 2019-12-23 01:02:02
问题 I have an existing rails application where I am working on a separate branch to implement yarn for managing my vendor assets. My app stack is: ruby-2.4.0 rails 5.1.4 node 9.4.0 yarn 1.3.2 After installing yarn, I ran yarn init and it generated a package.json in the project root. After a few packages added, it looks like: # package.json { "name": "my-project-name", "version": "1.0.0", "private": true, "repository": "my-repo", "author": "me", "license": "MIT", "dependencies": { "bootstrap": "3"

Docker compose missing yarn dependencies on build

拟墨画扇 提交于 2019-12-22 10:02:23
问题 Can't get node_modules folder when running yarn install in the Dockerfile test-sof ├── docker-compose.yml ├── Dockerfile ├── package.json └── yarn.lock docker-compose.yml version: '3' services: web: build: . volumes: - .:/myapp package.json { "name": "site", "private": true, "dependencies": { "@rails/webpacker": "^3.2.1", "babel-preset-react": "^6.24.1", "prop-types": "^15.6.0", "react": "^16.2.0", "react-dom": "^16.2.0", "reactjs": "^1.0.0", "underscore": "^1.8.3" }, "devDependencies": {

Simple - React and OData

我的梦境 提交于 2019-12-22 09:55:06
问题 I'm completely new to React and having a hard time understanding it. I've been tasked with creating a really simple API fetch to an OData endpoint. Now, I've come across this library https://www.npmjs.com/package/react-odata Which looks fantastic! However I just do not understand how to even get something like this working. I understand the very basic principles of how react works and have gone through many basic tutorials. But for whatever reason I can not get my head around this one. So how

Heroku build failing due to Yarn and npm lockfile conflict

爷,独闯天下 提交于 2019-12-22 05:41:43
问题 Im trying to deploy React Web app on Heroku using the CLI. However when I run, git push heroku master from my project folder it throws an error as: Counting objects: 213, done. Delta compression using up to 4 threads. Compressing objects: 100% (212/212), done. Writing objects: 100% (213/213), 515.89 KiB | 0 bytes/s, done. Total 213 (delta 40), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Node.js app detected remote: remote: -----

Heroku build failing due to Yarn and npm lockfile conflict

让人想犯罪 __ 提交于 2019-12-22 05:41:33
问题 Im trying to deploy React Web app on Heroku using the CLI. However when I run, git push heroku master from my project folder it throws an error as: Counting objects: 213, done. Delta compression using up to 4 threads. Compressing objects: 100% (212/212), done. Writing objects: 100% (213/213), 515.89 KiB | 0 bytes/s, done. Total 213 (delta 40), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Node.js app detected remote: remote: -----

Error: jest-haste-map: Haste module naming collision:

独自空忆成欢 提交于 2019-12-22 02:33:18
问题 I have created a custom npm module (will use xxx instead of its name) and link it manually using npm install . I tried very hard and searched : [Workarounds] Packager unable to resolve module from /Users/node_modules/ Error: jest-haste-map: @providesModule naming collision when using a local dependency before raising a question. I would be thankful if someone tell me what wrong with my code or my approach or any error in my code. When I run react-native run-android following error is raised

How to override global yarn registry for particular project

China☆狼群 提交于 2019-12-21 04:43:07
问题 For most projects I pull packages from the internal server, so it's been added by yarn config set registry http://custom-packages-server.com But now in the new project I'd like to use the different (default) one, but use it in that particular project only. As far as I understood if I run the following command inside of new project's directory yarn config set registry https://registry.yarnpkg.com it's going to update global registry value for all other projects as well, so they also will be