Npm install package in absolute path (Locally and package.json)

First of all, a huge apology for the naive question, and if that sounds duplicate.

I want to install a package, for example material-ui , as an external dependency on another path, for example ./node_module/my-material-ui . The problem is that I cannot find any option to tell npm to do this, except for the --prefix option, which does not really help, because it installs the package under ./node_module/my-material-ui/node_modules/material-ui . Infact, this makes sense, since these are prefixes of the installation path. I searched, but did not immediately find a solution.

As a next question, instead of individually (and locally) installing the above package using npm install ... you want to specify where the package should be installed in package.json . In other words, how to achieve the specified goal is possible by indicating what is inside package.json .

Thank you in advance for your help and recommendations!

0
source share
1 answer

This scenario describes the migration guide .

 yarn add material-ui@latest yarn add material-ui-next@npm : material-ui@next 

then

 import FlatButton from 'material-ui/FlatButton'; // v0.x import Button from 'material-ui-next/Button'; // v1.x 
+1
source

Source: https://habr.com/ru/post/1264271/


All Articles