简体   繁体   English

指示在哪个文件夹中安装包npm

[英]indicate in which folder to install a packages npm

I'm getting closer to npm to manage the javascript of my project. 我越来越接近npm来管理我项目的javascript。

Looking at stackoverflow I saw this documentation: https://docs.npmjs.com/using-npm-packages-in-your-projects 看看stackoverflow,我看到了这个文档: 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 我想安装这个软件包: 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. 运行它,他将把包放在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... 总是看我发现的文档: npm install <folder> ,所以我在npm install结束时尝试了一个告诉路径到目录,但是将它安装在node_modules文件夹中......

I'm using Laravel, and if I want to install something from npm to public/inc/plugins, which is the correct procedure? 我正在使用Laravel,如果我想从npm安装到public / inc / plugins,这是正确的程序吗? is it possible to indicate this in the packages.json file? 是否可以在packages.json文件中指出这一点? If it is recommended to use the installation in the main node, how can I then use the js? 如果建议在主节点中使用安装,那么我该如何使用js? with a reconstruction with webpack mix? 与webpack混合重建?

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. 如果文件夹位于项目的根目录内,则其依赖关系可能会升级到顶层node_modules,就像它们对其他类型的依赖项一样。

Here you can find an answer on StackOverflow 在这里,您可以找到StackOverflow的答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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