简体   繁体   English

为什么在“ npm install express”之后,我的目录中没有package.json?

[英]Why after “npm install express” there is no package.json in my directory?

I am using latest version of nodejs, 0.10.24 我正在使用最新版本的nodejs 0.10.24

I followed this tutorial: http://net.tutsplus.com/tutorials/javascript-ajax/how-to-scrape-web-pages-with-node-js-and-jquery/ 我遵循了本教程: http : //net.tutsplus.com/tutorials/javascript-ajax/how-to-scrape-web-pages-with-node-js-and-jquery/

after installing npm install express , I can't find the package.json file in the same directory. 安装npm install express ,我无法在同一目录中找到package.json文件。

But when I tried this on Windows a few months before, I noticed that there was a file in the same directory. 但是几个月前我在Windows上尝试此操作时,发现同一目录中有一个文件。

Is there anything I need to do to fix? 我有什么需要修复的吗?

Thanks, 谢谢,

When you npm install module ,the only goal is to download and save the module in ./node_module/ directory. 当您npm install module ,唯一的目标是将模块下载并保存在./node_module/目录中。

If you want get a package.json, you must use npm init and fill all the information asked. 如果要获取package.json,则必须使用npm init并填写所有要求的信息。

After that, you can make npm install module --save , that command will download and add the module in your package.json. 之后,您可以使npm install module --save ,该命令将下载该模块并将其添加到package.json中。

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

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