美文网首页
npm常用命令

npm常用命令

作者: 一只重拾梦想的小水 | 来源:发表于2019-01-14 14:18 被阅读0次

一、基本命令

-g: --global全局,一处安装,处处可用

--save: local(本地模式,只在当前文件夹下) 写入dependencies

--save-dev: local & 写入devDependencies

使用者:

install  安装,默认最新版本,@ ^ ~ semver请参考pkg semver 详解

uninstall 卸载 -g, --save, --save-dev

update 更新,项目中一般用install,避免版本不一致

outdated 非最新版本的包

list \ ls \ la \ ll  查看包安装信息

view \ info  包远程信息 (远程!远程!本地信息用上一个  ls)

version

init 生成package.json

npm init --yes 想要偷懒步免去一直按 enter

.npm-init.js 定制init(输入/default)

help 详细、基本语法

root 本地、全局

config 配置信息

不常用的

cache 缓存

start、stop、restart、run dev、run build    package.json的scripts字段自定义的命令

shrinkwrap  跟lock一个作用,优先级高于lock

link 创建全局软链接

build  install、link时自动调用

rebuild  重装node后重新构建c++等扩展

发布者:

adduser 发布npm社区前需要先登录

publish 发布

test 自定义

access 设置访问权限

二、常见包的介绍

node-gypIf one of the packages npm tries to install is a native node module and requires compiling of C++ Code, npm will use node-gypfor that task.

C++或native扩展的编译

三、some point:

关于install \ update的不同

config:

命令行、.npmrc

proxy: 代理

registry: mnpm、cnpm url

set \ get \ delete..

参考:

https://segmentfault.com/a/1190000013962514?utm_source=tag-newest

https://www.cnblogs.com/itlkNote/p/6830682.html

相关文章

  • npm 常用命令缩写

    npm 常用命令缩写,不断更新 npm i === npm install npm i webpack -D ==...

  • ionic常用命令

    常用命令: npm install -g cnpm --registry=https://registry.npm...

  • [mark] npm 了解一下~

    npm 常用命令及解析

  • npm常用命令

    npm常用命令 npm init 生成package.json文件 npm install 安装package.j...

  • Yarn 常用命令

    Yarn 常用命令 ``` npm install === yarn —— install安装是默认行为 npm ...

  • nodejs npm 常用命令

    国内镜像 设置代理 npm设置列表 npm config 所有的api npm 常用命令npm查看全局安装过的包 ...

  • Angular 学习笔记

    几个常用命令 npm + ng npm i --save 包名:软件依赖 npm i --save-dev 包名...

  • NPM

    npm 常用命令 1.react-native --version ...

  • npm命令

    1.查看npm 版本 2.npm淘宝镜像 3.npm常用命令说明 4.npm卸载 5.npm更新 6.npm清除缓...

  • NPM一些常用命令

    欢迎移步我的博客阅读:《NPM一些常用命令》 关于NPM NPM的全称是Node Package Manager,...

网友评论

      本文标题:npm常用命令

      本文链接:https://www.haomeiwen.com/subject/uygddqtx.html