yarnpkg

Difference between yarn/npm5 lockfiles and exact package versions?

我的梦境 提交于 2020-01-11 08:32:12
问题 My simple question is: why can't I just use exact versions in my package.json? How is this different from a lockfile? 回答1: 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

Use Gradle to run Yarn in every folder

点点圈 提交于 2020-01-06 16:26:50
问题 I have a folder with a lot of directories inside. I want to have a gradle script that will loop through them (not recursively) and run yarn build in them. I have tried two approaches (and started several different things), but alas no luck. task build (description: "Loops through folders and builds"){ FileTree tree = fileTree(dir: 'admin', include: '*/package.json') tree.each {File file -> println file} } task yarnBuild (type: Exec){ executable "bash" args "find . -type d -exec ls {} \\;" }

sending custom arguments to npm (yarn) scripts with lerna

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-04 07:51:11
问题 I have an issue when trying to pass arguments to an npm script with lerna . I have a node script that I want to run inside each package in the workspace. lerna docs suggests the following: { "scripts": { "my-script": "lerna exec -- node \\$LERNA_ROOT_PATH/scripts/my-script.js" } } so now, if I run in the root yarn run my-script it will run the script inside each package in the workspace. Sometimes, I need to scope the execution to a specific package. So running this from command line

react-native: switch from yarn to npm

冷暖自知 提交于 2020-01-01 08:46:06
问题 Is there a step-by-step process to change a react-native project from using yarn as the package manager to using npm? All I can find after several days of searching are instructions to go from npm to yarn and a package called deyarn which doesn't seem to fully work for me. Does anyone have a good resource on this? 回答1: Try this : Remove yarn.lock (don't need this file). Remove folder node_modules In package.json , change script use yarn to the same command with npm Remove all global package

No package found with specified pattern: D:\a\r1\a\**\*.zip

蹲街弑〆低调 提交于 2019-12-30 08:15:37
问题 I created a build definition in vsts with npm build and then I copy the build folder to the drop location. The build pipeline is working fine Then I created the release definition and it downloads the files correctly also: 2018-08-10T16:29:18.5241580Z Downloading artifact drop from: https://xx.visualstudio.com//_apis/resources/Containers/711976?itemPath=drop&isShallow=true&api-version=4.1-preview.4 2018-08-10T16:29:18.5252684Z Downloading drop/s/build/asset-manifest.json to D:\a\r1\a

JSON Error when create react app

你。 提交于 2019-12-30 07:25:09
问题 Trying to follow tutorial on react (Here: https://hackernoon.com/simple-react-development-in-2017-113bd563691f), but I keep getting JSON error "Error parsing JSON. unexpected end of JSON input." I'm using yarn. How do i fix the JSON input? 回答1: i faced the same issue & this solved the issue : try the below command in your terminal npm cache clean --force solution ref 回答2: For me the answer given by @M.abosalem didn't work but yarn cache clean did the trick 来源: https://stackoverflow.com

Multiple Step Definitions match error in Cucumber

霸气de小男生 提交于 2019-12-25 11:05:47
问题 I recently got started with Cucumber. I am trying to implement Cucumber+Protractor+TypeScript, using this link as the baseline. I am trying to follow this structure, C:. | ├───.circleci | ├───.vscode | ├───e2e │ ├───features | | |--sample.feature | | |--sample2.feature | | │ └───steps | | |--pageobject1_step.ts | | |--pageobject2_step.ts | | |--common_step.ts I have a simple feature inside both sample and sample2 feature files. However when I try running the tests, I get `Given I am on the

Multiple Step Definitions match error in Cucumber

只谈情不闲聊 提交于 2019-12-25 11:05:22
问题 I recently got started with Cucumber. I am trying to implement Cucumber+Protractor+TypeScript, using this link as the baseline. I am trying to follow this structure, C:. | ├───.circleci | ├───.vscode | ├───e2e │ ├───features | | |--sample.feature | | |--sample2.feature | | │ └───steps | | |--pageobject1_step.ts | | |--pageobject2_step.ts | | |--common_step.ts I have a simple feature inside both sample and sample2 feature files. However when I try running the tests, I get `Given I am on the

Separating Frontend & Backend Dependencies with Gulp/Yarn

别来无恙 提交于 2019-12-25 01:37:18
问题 I want to use yarn instead of bower + npm . Yarn uses package.json and does not separate between frontend and backend packages. I read so far, that I need to separate my frontend + backend dependencies with gulp: How to use one package manager for backend and frontend? (Yarn/NPM) My app uses the MEAN stack. Currently, I'm using e.g. wiredep to inject all frontend dependencies into my index.html . Question: How can I automatically separate the frontend dependencies from the backend

Export multiple modules from NPM package

折月煮酒 提交于 2019-12-24 19:48:08
问题 I have a rather large project A using Node and Typescript. In project A I have a lot of different modules that I would like to reuse in another project B. Therefore I have built the project A with this tsconfig.json: { "compilerOptions": { "target": "es2017", "module": "commonjs", "declaration": true, "outDir": "./dist", "sourceMap": true, "strict": true, "noImplicitAny": true, "strictNullChecks": true, "typeRoots": ["./node_modules/@types", "./modules/@types"] }, "exclude": ["node_modules"]