benallfree / npm-relink

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NPM Relink

This package re-establishes symlinks after npm i has run. This shortcoming of npm is a known issue that the npm team has been slow to fix, so here is a package to do it.

Installation

% npm install -g npm-relink

Usage

Initialize from your project root:

% npm i -D npm-relink
% npm-relink init
% echo ".npm-relink.json" >> .gitignore

Add a postinstall script to package.json:

"scripts": {
    "postinstall": "npm-relink"
}

Any time you run npm install, npm-relink should run afterward. If it doesn't, just run npm i again.

When you add a new link using npm link, run npm-relink init afterward to capture changes.

Further Development

I wish there were a way to do a post hook for dependency installation via npm install <package>. Something like depinstall ticket opened here

About


Languages

Language:JavaScript 100.0%