install npm 单独安装依赖包_nodejs 开发之二 npm install 安装依赖包

1. 执行 npm install ,

C:Program Files

odejsMyBook>npm install

npm notice created a lockfile as package-lock.json. You should commit this file.

npm WARN [email protected] No repository field.

up to date in 2.282s

found 0 vulnerabilities

2. 依赖包被安装到了 node_modules . 同时生成package-lock.json文件.

package-lock.jsaon 文件内容:

{

"name": "mybook",

"version": "1.0.0",

"lockfileVersion": 1

}

3. 安装项目需要的buffer包 npm install buffer 和 ignore

C:Program Files

odejsMyBook>npm install buffer

npm WARN [email protected] No repository field.

+ [email protected]

added 3 packages from 4 contributors and audited 3 packages in 5.157s

found 0 vulnerabilities

C:Program Files

odejsMyBook>npm install ignore

npm WARN [email protected] No repository field.

+ [email protected]

added 1 package from 1 contributor and audited 4 packages in 1.695s

found 0 vulnerabilities

自动生成了node_modules.

4.同时更新了: package-lock.json和Package.json文件:

{

"name": "mybook",

"version": "1.0.0",

"description": "My book shelf",

"main": "index.js",

"scripts": {

"test": "node app.js"

},

"author": "author",

"license": "ISC",

"dependencies": {

"ignore": "^5.1.8"

},

"devDependencies": {

"buffer": "^5.6.0"

}

}

{

"name": "mybook",

"version": "1.0.0",

"lockfileVersion": 1,

"requires": true,

"dependencies": {

"base64-js": {

"version": "1.3.1",

"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",

"integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==",

"dev": true

},

"buffer": {

"version": "5.6.0",

"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz",

"integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==",

"dev": true,

"requires": {

"base64-js": "^1.0.2",

"ieee754": "^1.1.4"

}

},

"ieee754": {

"version": "1.1.13",

"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",

"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==",

"dev": true

},

"ignore": {

"version": "5.1.8",

"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz",

"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw=="

}

}

}

nodejs 开发之二 npm install 安装依赖包

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值