Skip to content

命令

postinstall script was not run

没有执行它的 postinstall 脚本

sh
pnpm approve-builds -g

跳过脚本安装

sh
pnpm install --ignore-scripts

npm install git

sh
# http
npm install git+https://github.com/your-org/my-shared-types.git

# ssh
npm install git+ssh://git@github.com:your-org/my-shared-types.git

锁定版本

json
"dependencies": {
  "@your-org/shared-types": "git+https://github.com/your-org/my-shared-types.git#v1.0.0"
}

分支

sh
npm install git+https://github.com/your-org/my-shared-types.git#main

发布 npm 包

sh
npm login

# 添加 NPM账号
npm adduser

# 查看当前登录的账号
npm whoami

# 登出当前账号
npm logout
sh
npm publish

npm publish --access public
sh
# patch:补丁号,修复bug,小变动,如 v1.0.0->v1.0.1
npm version patch

# minor:次版本号,增加新功能,如 v1.0.0->v1.1.0
npm version minor

# major:主版本号,不兼容的修改,如 v1.0.0->v2.0.0
npm version major

.npmignore 用法与 .gitignore