我对 Node.JS 非常陌生(我的背景是 Unity C#,如果这对您进行比较有帮助的话)。
我正在学习 Socket.IO 的聊天教程
http://socket.io/get-started/chat/
我不明白这是什么意思
First let’s create a package.json manifest file that describes our project.
I recommend you place it in a dedicated empty directory (I’ll call mine
chat-example).
{
"name": "socket-chat-example",
"version": "0.0.1",
"description": "my first socket.io app",
"dependencies": {}
}
Now, in order to easily populate the dependencies with the things we need, we’ll
npm install --save express@4.10.2
- 什么是“保存”?
- 这是否意味着在命令提示符下使用 服务器安装了 Node.JS?
最佳答案
- --save 表示您希望 npm 命令将他刚刚安装的软件包及其相应版本写入您的 package.json 文件中。特别是在依赖属性中。将您的代码分发给托管服务和其他服务非常重要。
- 安装完 Node.js 后,您可以打开终端并执行此命令。在某些服务器上,package.json 会自动执行。也就是说,将安装依赖项,运行脚本。
关于javascript - npm install --saveexpress@4.10.2 是什么意思以及如何使用它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41537089/