安装依赖
npm install
npm i
npm ci # 按 lockfile 干净安装(CI 推荐)包管理
安装、脚本、镜像配置与发布常用命令。 — 共 15 条
共 15 条代码片段
npm install
npm i
npm ci # 按 lockfile 干净安装(CI 推荐)npm install lodash
npm install lodash --save
npm install -D typescript # 开发依赖
npm install -g npm # 全局安装npm uninstall lodash
npm uninstall -D typescript
npm uninstall -g npmnpm update
npm update lodash
npm outdated
npx npm-check-updates -u # 升级 package.json 版本号npm list
npm list --depth=0
npm ls lodash
npm view lodash versionnpm run dev
npm run build
npm start # 等价 npm run start
npm test # 等价 npm run test
npm run lint -- --fix{
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint .",
"prepare": "husky"
}
}npx create-next-app@latest
npx eslint .
npx --yes cowsay hellonpm config get registry
npm config set registry https://registry.npmmirror.com
npm config set registry https://registry.npmjs.org
# 临时使用
npm install --registry=https://registry.npmmirror.comregistry=https://registry.npmmirror.com
save-exact=true
engine-strict=true
legacy-peer-deps=truenpm init -y
npm init @eslint/confignpm cache verify
npm cache clean --forcenpm login
npm whoami
npm publish
npm publish --access public
npm unpublish pkg@1.0.0npm version patch # 1.0.0 -> 1.0.1
npm version minor # 1.0.0 -> 1.1.0
npm version major # 1.0.0 -> 2.0.0
npm version 1.2.3npm pack
npm pack --dry-run