使用npm link 创建本地模块
本站寻求有缘人接手,详细了解请联系站长QQ1493399855
1. npm link 介绍
创建一个全局的符号链接,优点是方便我们进行本地node模块的开发调用,和后期发布私服,或者npm 仓库调用是一致的以下为官方的说明:First, npm link in a package folder will create a symlink in the global folder {prefix}/lib/node_modules/<package>
that links to the package where the npm link command was executed. (see npm-config for the value of prefix). It will
also link any bins in the package to {prefix}/bin/{name}.
Next, in some other location, npm link package-name will create a symbolic link from globally-installed package-name
to node_modules/ of the current folder.
Note that package-name is taken from package.json, not from directory name.