Historically, the npm init command was solely use to create a new package.json file. However, as of npm version 6.1, you can now use a new feature of npm init called the . The initializer you provide will determine how your new application will be built. npm will prepend create- to the name of the initializer and it'll use npx to temporarily install and execute that project.

 For example, to create a react app, what you can do with npm v5.3 above is like:
npx create-react-app playground

What it does is install 'create-react-app' temporality, and use it to init a new react application called 'playground'.

For npm v6.1 above, you can use 'npm init' to create a new application.

npm init <initializer> can be used to set up a new or existing npm package.

initializer in this case is an npm package named create-<initializer>, which will be installed by npx, and then have its main bin executed -- presumably creating or updating package.json and running any other initialization-related operations. Link

Which means if you do:

npm init react-app playground

equals to:

npx create-react-app playground

[NPM] Create a new project using the npm init <initializer> command的更多相关文章

  1. Mac 安装node npm cnpm vue 以及卸载 node 和 npm 的方法 清空npm缓存的方法

    S01 安装node(内含npm) 首先,到官网下载长期支持版,截止目前,最新的长期支持版本号是10.16.3 https://nodejs.org/zh-cn/download/ 下载完毕后,安装该 ...

  2. npm 使用过程中报错问题-及npm使用

    原文地址:https://blog.csdn.net/u013022210/article/details/77740519 1.以下为报错具体详情:node 8.1.2 版本问题:其他空间安装成功但 ...

  3. koa2第一天 安装koa2found 1 low severity vulnerability run `npm audit fix` to fix them, or `npm audit` for details

    安装全局koa2:npm install -g koa2 -generator 创建一个koa2文件夹:koa2 -e koa2 进入koa2文件夹:cd koa2 安装npm模块:npm insta ...

  4. command failed: npm install --loglevel error --registry=https://registry.npm 用vue-cli 4.0 新建项目总是报错

    昨天新买的本本,今天布环境,一安装vue-cli发现都4.0+的版本了,没管太多,就开始新建个项目感受哈,一切运行顺利,输入 "vue create app" 的时候,一切貌似进展 ...

  5. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (default-cli) on project standalone-pom: Unable to parse configuration of 3: mojo org.apache.maven.plugins:

    问题: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (defau ...

  6. found 12 vulnerabilities (7 moderate, 5 high) run `npm audit fix` to fix them, or `npm audit` for details

    npm 安装包之后,如果出现类似下面的信息 found 12 vulnerabilities (7 moderate, 5 high) run `npm audit fix` to fix them, ...

  7. npm run dev 报错 run `npm audit fix` to fix them, or `npm audit` for details

    前几天写的直接运行npm run dev还是ok的,突然不行了,前面报错是css-loader没有,删除style标签上的lang='scss'就好了,先不需要这个依赖.这个先不管. 只是后面的 ru ...

  8. run `npm audit fix` to fix them, or `npm audit` for details

    问题 added 246 packages from 681 contributors and audited 382 packages in 17.509s found 13 vulnerabili ...

  9. Nodejs的npm安装模块时候报错:npm ERR! Error: CERT_UNTRUSTED的解决方法

    npm http GET https://registry.npmjs.org/grunt-cli npm http GET https://registry.npmjs.org/grunt-cli ...

随机推荐

  1. Vue.js系列之vue-router(上) (转载自向朔1992)

    概述 Vue非常适用于实践单页面应用程序也就是平时大家说的比较多的SPA(single page application),这点应该了解过Vue的应该都知道吧.一般的单页面应用是基于路由或页面之间的链 ...

  2. C++派生类继承父类修饰符

    公式: 继承成员对外的访问属性 = Max{继承方式,父类成员访问级别}: 1.如果子类从父类继承时使用的继承限定符是public,那么(1)父类的public成员成为子类的public成员,允许类以 ...

  3. Vickers Vane Pump Tips - Vane Pump Maintenance Note

    The    Vickers Vane Pump    describes the matters needing attention in the maintenance of the vane p ...

  4. HTML中 DOM操作的Document 对象详解(收藏)

    Document 对象Document 对象代表整个HTML 文档,可用来访问页面中的所有元素.Document 对象是 Window 对象的一个部分,可通过 window.document 属性来访 ...

  5. 【mybatis】mybatis数据源源码剖析(JNDI、POOLED、UNPOOLED)

    一.概述 二.创建 mybatis数据源的创建过程稍微有些曲折. 1. 数据源的创建过程: 2. mybatis支持哪些数据源,也就是dataSource标签的type属性可以写哪些合法的参数? 弄清 ...

  6. iOS开发基础知识

    1:App跳转至系统Settings 跳转在IOS8以上跟以下是有区别的,如果是IOS8以上可以如下设置: NSURL *url = [NSURL URLWithString:UIApplicatio ...

  7. 去除ie下select框箭头

    select::-ms-expand { display: none;}兼容ie10及以上

  8. 深入理解Spring IoC容器和动态代理机制

    Deployment期间验证 实现一: <bean id="theTargetBean" class="..."/> <bean id=&qu ...

  9. 跟初学者学习IbatisNet第一篇

    写在前面的话:我自己也是一个初学者,写这个专题只是为了对学过知识的巩固,如果有什么不对的地方,欢迎大家指正…………………… 第一篇就简单介绍一下什么是IbatisNet,然后写一个简单的Demo,在后 ...

  10. 大数据学习——flume拦截器

    flume 拦截器(interceptor)1.flume拦截器介绍拦截器是简单的插件式组件,设置在source和channel之间.source接收到的事件event,在写入channel之前,拦截 ...