Search code examples
javascriptnode.jsnpmcreate-react-appyarnpkg

How do you use "yarn create <pkg-name>"?


I was reading Yarn blog and found it supports yarn create just like create-react-app.

https://yarnpkg.com/blog/2017/05/12/introducing-yarn/

I tried locally... basically made very simple application with following package.json.

{
  "name": "create-test-app",
  "version": "1.0.0",
  "bin": {
    "create-test-app": "./index.js"
  },
  "dependencies": {
    ...
  }
}

But somehow,,, it is complaining that it can't find the package. "error Couldn't find package "create-test-app" on the "npm" registry.

In order to use "yarn create", I should upload on "npm" registry? Can't try it in locally? Thanks in advance.


Solution

  • Yarn takes from NPM and does not have its own mechanism for creating packages. When you create a package on NPM, Yarn will actually grab its details through the NPM Registry.

    More information: http://blog.npmjs.org/post/151660845210/hello-yarn