nodejs

npm

2017-08-18  本文已影响23人  别过经年
1. npm-shrinkwrap 类似yarn.lock固定包的依赖 以及包内部的依赖
2. node-sass 在项目启动时经常报错,很多时候运行npm rebuild node-sass就好了,官网对rebuild命令的解释:

This command runs the npm build command on the matched folders. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary.

3.npm publish <package name>

在使用lerna publish的时候直接从0.1.0 跳到了 0.2.0 ,我们往往是很小版本的更新,可以手动更改version版本号,也可以使用npm version patch更改最小的版本号

npm官网给的解释
How to Publish & Update a Package

How to Update the Version Number

When you make changes, you can update the package using

npm version <update_type>

where <update_type> is one of the semantic versioning release types, patch, minor, or major.

image.png
$ lerna publish --cd-version (major | minor | patch | premajor | preminor | prepatch | prerelease)
# uses the next semantic version(s) value and this skips `Select a new version for...` prompt

手动更改packages下面的某个包的version publish只会publish这个包,并且lerna会在你更改的基础上自动增加版本号

显示package信息
npm info <package name>

npm publish --tag=beta

npm包实现发布正式和测试版

第一次npm publish --tag=beta的时候verdaccio的控制界面是能看到的,再次发正式版verdaccio就看不到beta的版本号了,想完整查看发版信息的话就用npm info <package name>

上一篇 下一篇

猜你喜欢

热点阅读