xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

yarn 1.x & yarn 2.x All In One

yarn 1.x & yarn 2.x All In One

yarn 1

$ npm install --global yarn

https://classic.yarnpkg.com/en/docs/install#mac-stable

https://github.com/yarnpkg/yarn

yarn 2

corepack

$ corepack enable

$ yarn init -2

https://github.com/yarnpkg/berry

https://yarnpkg.com/features/zero-installs

yarn patch

# pacth ???
$  yarn patch <package>

https://yarnpkg.com/cli/patch

patch npm node_modules & patch-package All In One


{
  "name": "patch-package-in-action",
  "version": "1.0.0",
  "description": "patch-package in action",
  "main": "./src/index.ts",
  "type": "module",
  "scripts": {
    "dev-esm": "npx ts-node-esm ./src/index.ts",
    "app-esm": "npx ts-node-esm ./src/app.ts",
    "dev": "npx ts-node ./src/index.ts",
    "app": "npx ts-node ./src/app.ts",
    "rmrf": "rimraf ./patchs",
    "postinstall": "patch-package",
    "patch-lodash": "npx patch-package lodash",
    "patch-lodash-es": "npx patch-package lodash-es",
    "patch-all": "npx patch-package lodash && npx patch-package lodash-es",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/web-fullstack/patch-package-in-action.git"
  },
  "keywords": [
    "patch-package",
    "node_modules",
    "npm",
    "Node.js",
    "patch"
  ],
  "author": "xgqfrms",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/web-fullstack/patch-package-in-action/issues"
  },
  "homepage": "https://github.com/web-fullstack/patch-package-in-action#readme",
  "dependencies": {
    "lodash": "^4.17.21",
    "lodash-es": "^4.17.21",
    "patch-package": "^6.5.1",
    "typescript": "^5.0.2"
  },
  "devDependencies": {
    "@types/lodash": "^4.14.191",
    "@types/lodash-es": "^4.17.7",
    "app-node-env": "^1.4.7",
    "rimraf": "^4.4.0",
    "ts-node": "^10.9.1"
  }
}


https://www.cnblogs.com/xgqfrms/p/17242430.html

yarn add & license

image

$ yarn add
yarn add v1.22.4
warning package.json: No license field
error Missing list of packages to add to your project.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

https://yarnpkg.com/en/docs/cli/add

缺少 license, 为什么不能安装呀!

{
  "license": "MIT",
}

https://classic.yarnpkg.com/en/docs/cli/licenses

refs



©xgqfrms 2012-2020

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2022-07-27 09:43  xgqfrms  阅读(196)  评论(4编辑  收藏  举报