package.json操作

2021-02-07  本文已影响0人  天马行空_9f6e

1.创建 package.json

   npm init 或者  npm init --yes

2.package.json文件

{

  "name": "demo3.2",

  "version": "1.0.0",

  "description": "",

  "main": "index.js",

  "scripts": {

    "test": "echo \"Error: no test specified\" && exit 1"

  },

  "keywords": [],

  "author": "",

  "license": "ISC",

  "dependencies": {

    "md5": "^2.3.0",                    --(安装模块的时候,npm install md5 --save  这个后面加上--save 就可以把内容写入到这里)

    "silly-datetime": "^0.1.2"    

  }

}

^表示第一位版本号不变,后面的两位取最新的

~表示前两位不变,最后一个取最新的

*表示全部取最新

上一篇 下一篇

猜你喜欢

热点阅读