简体   繁体   中英

How to install node modules to a folder outside the project folder?

I am running a React project and npm install installs all of the modules in the root folder of the project, in which it creates around 30 000 new files, which then slows dows web cloud syncing (I am unable to exclude locations). How can I install this large directory at a different location, that is outside the project folder or maybe globally somehow?

I have tried npm install -g after deleting the node_modules folder, but that said that everything is up to date and npm list -g shows only one item, that is the project. After that running npm start does not work, gives error 'react-scripts' is not recognized as an internal or external command

Learn Next JS and try to make server side rendering

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM