nodejs初始化init

打开cmd创建即可

$ npm init  
Package name: (hello)     //模块名字,npm init会自动取当前目录名作为默认名字,这里不需要改,直接确认即可  
Description: A example for write a module    //模块说明  
Package version: (0.0.0) 0.0.1    //模块版本号,这个大家按自己习惯来定就可以  
Project homepage: (none)     //模块的主页,如果有的话可以填在这里,也可以不填  
Project git repository: (none)    //模块的git仓库,选填。npm的用户一般都使用github做为自己的git仓库  
Author name: Elmer Zhang    //模块作者名字  
Author email: (none) freeboy6716@gmail.com     //模块作者邮箱  
Author url: (none) http://www.elmerzhang.com    //模块作者URL  
Main module/entry point: (none) hello.js     //模块的入口文件,我们这里是hello.js </span><span style="color:#ff6666;">(这个必填)</span><span style="color:#333333;">  
Test command: (none)    //测试脚本,选填  
What versions of node does it run on? (~v0.5.7) *   //依赖的node版本号,我们这个脚本可以运行在任何版本的node上,因此填 *  
About to write to /home/elmer/hello/package.json  
// 以下是生成的package.json文件内容预览  
{  
  "author": "Elmer Zhang <freeboy6716@gmail.com> (http://www.elmerzhang.com)",  
  "name": "hello",  
  "description": "A example for write a module",  
  "version": "0.0.1",  
  "repository": {  
    "url": ""  
  },  
  "main": "hello.js",  
  "engines": {  
    "node": "*"  
  },  
  "dependencies": {},  
  "devDependencies": {}  
}  
  
Is this ok? (yes)   //对以上内容确认无误后,就可以直接回车确认了


  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值