npm link用法总结

npm link用来在本地项目和本地npm模块之间建立连接,可以在本地进行模块测试

具体用法:

1. 项目和模块在同一个目录下,可以使用相对路径

npm link ../module

2. 项目和模块不在同一个目录下

cd到模块目录,npm link,进行全局link

cd到项目目录,npm link 模块名(package.json中的name)

3. 解除link

解除项目和模块link,项目目录下,npm unlink 模块名

解除模块全局link,模块目录下,npm unlink 模块名

原文地址:https://www.cnblogs.com/mengff/p/11743145.html

时间: 2024-08-09 03:42:13

npm link用法总结的相关文章

npm link 的用法

npm link 的用法 先到对应的自定义包下执行 npm link 会读取对应的 packagejson 中的名称 然后到对应的目录下执行 npm link your/own/npm/name 就会看到对应的提示 原文地址:https://www.cnblogs.com/asdfq/p/10994227.html

[Node.js] Using npm link to use node modules that are "in progress"

It is some times convenient, even necessary, to make use of a module that you are working on before it has been published to the node package manager (npm). The npm link command makes this simple. For example: upper/index.js: module.exports = functio

[NPM] Test npm packages locally in another project using npm link

We will import our newly published package into a new project locally to make sure everything is working as expected. We can do this locally before publishing with npm link. This creates a symbolic link in our node_modules folder, so our unpublished

npm link实践演示

如果你用npm这个包管理来安装node包的话,只能是该包的开发者已经传到npm上面的版本. 但是有时候,一些开源的包,如果修复了一些bug或新增一些新功能之后,但是还没有更新到npm上面.这个时候,你无法通过npm install来获取该包最新的代码. npm link可以做到,我们项目里面用到的pomelo这个包,就是通过npm link来使我们所用的pomelo代码是最新的. 下面用wechat这个包来举例并演示说明. 1. 2. 3. 4. 5. 6. 7. 8. 9. 参考资料 http

使用npm link 加速调试

我们在把包发布到npm上时,如果需要对本地的包进行修改,我们需要改变一个版本,重新发布.然后测试时需要更新这个包进行测试.这样的话,每一次的调试都特别麻烦.我们可以使用npm link来加速这个调试过程. 步骤1:在项目根目录下运行npm link npm link 步骤2:在项目之外使用到这个包的根目录下运行npm link xxx npm link + 包的名称 步骤3: 当项目中进行了修改时,项目外就能够获得最新的代码了. 原文地址:https://www.cnblogs.com/yinh

ifconfig、route、ip route、ip addr、 ip link 用法

网络管理是一个复杂而庞大的体系,博主最近刚好学了一点关于网络的知识,就跟大家分享一下,如何管理网卡.配置及查看ip地址和路由表.主要通过以下几个命令来演示一下. 一.ifconfig 1)配置地址: 比如修改eth0网卡的ip为192.168.174.100,子网掩码为255.255.255.0 ifconfig eth0 192.168.174.100/24 使用ifconfig修改ip会直接在内存中生效,重启系统或者重启network服务就丢失. 重启服务:Centos6:service n

Myeclipse *.link用法

引用路径 path=D:\\ProgramData\\MyEclipse\\adt

npm package.json属性详解

章节目录 概述 name version description keywords homepage bugs license 和用户相关的属性: author, contributors files main bin man directories directories.lib directories.bin directories.man directories.doc directories.example repository scripts config dependencies U

NPM使用技巧

如果你是一个JavaScript系的开发者,一定不会陌生NPM,它既是一个平台,也是一个工具.在这个平台上,我们能够使用其他开发者提供的功能代码,当然我们也能将我们自己代码提交到这里分享给世界上的开发者. 以下记录一些NPM作为工具的一些使用技巧. npmrc .npmrc 做为npm的配置文件,它可以定义在多个地方. ~/.npmrc 用户根目录,根目录内所有的npm指令都会查询到该配置 /path/to/npm/npmrc npm内建配置文件 ./.npmrc 当前项目根目录,用于配置特定于