简体   繁体   English

npm install安装到哪个文件夹中

[英]Into which folder does npm install installs

I installed an application via npm install and I can open the application in my webbrowser via http://localhost:3000/without any problem. 我通过npm install安装了一个应用程序,并且可以通过http:// localhost:3000 /在我的Web浏览器中打开该应用程序, 而没有任何问题。 What folder do I have to open to see what is displayed when I open the URL http://localhost:3000/ in my webbrowser? 我必须打开哪个文件夹才能看到在Web浏览器中打开URL http:// localhost:3000 /时显示的内容?

by default npm install will install packages into node_modules which resides in your project root where package.json is located. 默认情况下,npm install会将软件包安装到位于package.json所在项目根目录中的node_modules中。
It seems you have a script which will spin up a webserver, in most cases it will not expose the node_modules directory on that webserver (for good reason). 看来您有一个脚本可以启动Web服务器,在大多数情况下,它不会公开该Web服务器上的node_modules目录(有充分的理由)。

The point is that you should be including the packages you installed within the script you use for your application that is served. 关键是您应该将所安装的软件包包括在用于所提供的应用程序的脚本中。

edit: you can read up on how to use nodejs packages here: https://docs.npmjs.com/using-npm-packages-in-your-projects 编辑:您可以在这里阅读如何使用nodejs包: https ://docs.npmjs.com/using-npm-packages-in-your-projects

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

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