npm init 和npm install的区别
npm 区别 install init
2023-09-11 14:21:26 时间
区别
npm init :生package.json文件,里面有各种依赖包的信息(执行该命令后终端会依次询问 name, version, description 等字段)
npm install :安装package.json文件中的依赖包到并且生成node_modules文件夹
npm init 相关命令
npm init -y :快速初始化项目
npm install 相关命令
命令 | 说明 |
npm inistall xxx | 本地安装,安装到项目目录下,不在package.json中写入依赖 |
npm inistall xxx -g | 安装在Node安装目录下的node_modules下 |
npm inistall xxx --s | 安装到项目目录下,并在package.json文件的dependencies中写入依赖 |
npm inistall xxx --s -d | 安装到项目目录下,并在package.json文件的devDependencies中写入依赖 |
相关文章
- 解决npm install 报错“npm WARN pug-loader@2.4.0 requires a peer of pug@^2.0.0 but none is installed. You must install peer dependencies yourself.“
- npm install —— 从一个简单例子,看本地安装与全局安装的区别
- npm安装node-sass失败
- npm是什么,用来干嘛的
- npm install 错误 安装 chromedriver 失败的解决办法
- npm_config_
- [NPM] Update published npm packages using np
- [NPM] Publish npm packages using npm publish
- [NPM] Create a node script to replace a complex npm script
- [NPM] Pull out npm scripts into another file with p-s
- [NPM] Use custom config settings in your npm scripts
- [NPM] Run npm scripts when files change with onchange
- [NPM] Pipe data from one npm script to another
- [NPM] Run a set of similar npm scripts with a wildcard
- 使用NPM Scripts打造简单的自动化构建工作流
- [NPM + React] Prepare a Custom React Hook to be Published as an npm Package
- [NPM] Set default values for package.json using npm set
- [NPM] npm check to update the dependencies
- [NPM] Update published npm packages using np
- [NPM] Test npm packages locally in another project using npm link
- [NPM] Pull out npm scripts into another file with p-s
- [NPM] Use package.json variables in npm scripts
- vue npm run serve/dev命令后台运行:nohup npm run serve >web.log 2>&1 & exit
- npm install -g -S -D的区别及应用场景
- npm warn config global `--global`, `--local` are deprecated. use `--location=global` instead.
- electron安装npm和cnpm均失败Failed at the electron@5.0.13 postinstall script.
- 【异常】解决npm install慢的问题,在国内被墙