简体   繁体   中英

indicate in which folder to install a packages npm

I'm getting closer to npm to manage the javascript of my project.

Looking at stackoverflow I saw this documentation: https://docs.npmjs.com/using-npm-packages-in-your-projects

but honestly I understood little and nothing...

I would like to install this package: npm install lightgallery lg-thumbnail lg-autoplay lg-video lg-fullscreen lg-pager lg-zoom lg-hash lg-share

running it he will put the package in node_modules.

always looking at the documentation I found: npm install <folder> , so I tried an told path to the directory at the end of npm install, but the install it inside the node_modules folder...

I'm using Laravel, and if I want to install something from npm to public/inc/plugins, which is the correct procedure? is it possible to indicate this in the packages.json file? If it is recommended to use the installation in the main node, how can I then use the js? with a reconstruction with webpack mix?

You shouldn't do that, because this is standard, and other developers may feel uncomfortable if you change this behavior.

In documentation, you can find:

Install the package in the directory as a symlink in the current project. Its dependencies will be installed before it's linked. If folder sits inside the root of your project, its dependencies may be hoisted to the toplevel node_modules as they would for other types of dependencies.

Here you can find an answer on StackOverflow

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