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. iview tabs里面放入 i-switch 注意slot不是写在 props里面

    iview tabs里面放入 i-switch 注意slot不是写在 props里面 <Tabs value="name1"> <TabPane :label=& ...

  2. iview分析

  3. 查看本机的ip地址

    ifconfig可以查看本机的ip地址:inet addr:10.108.104.185

  4. 苹果面临起诉:App Store 涉嫌垄断吗?

    今日导读 现代社会,手机在手,啥也不愁.购物不用带钱包,网上支付可以搞定一切:旅游懒得背相机,修图 App 帮你打造最美的自己.看直播.学英语.玩游戏.听音乐,我们的生活已经充斥着各类 App.据悉, ...

  5. Android开发案例 - 淘宝商品详情【转】

    http://erehmi.cnblogs.com/ 所有电商APP的商品详情页面几乎都是和淘宝的一模一样(见下图): 采用上下分页的模式 商品基本参数 & 选购参数在上页展示 商品图文详情等 ...

  6. SMTP error 554 !!

    哇,我真的amazing, incredible!! 我只是想写一个简单的邮件,结果他一直报554错误!!! 期间,通过百度,我发现了可能导致 此,讨厌至极的错误,有N多原因: 但我的原因 谜之离谱! ...

  7. POJ-2442-Sequence(二叉堆)

    POJ-2442 Description Given m sequences, each contains n non-negative integer. Now we may select one ...

  8. 华为S5700交换机初始化和配置SSH和TELNET远程登录方法

    基础设置: 配置登陆IP地址<Quidway> system-view                                                            ...

  9. ssh服务使用介绍二

    老司机开车了 快上车 上文提到当我们使用ssh远程链接主机的时候,会出现询问的提示,如果我们链接的机器多了,一遍一遍的输入是不是很麻烦?怎么解决如下 vim /etc/ssh/ssh_config 如 ...

  10. (一)Robot Framework安装

    准备工作: Python 2.7 (目前不能良好支持python3) pip 和 setuptools (Python 的套件管理程式,最新版的Python 2.7.16已包含) Robot Fram ...