In the HTML file, you may have seen that you are using a Socket.IO file:
<script src="/socket.io/socket.io.js"></script>
At the top level of your work directory create a file named package.json with the following contents:
{ "name": "webrtc-codelab", "version": "0.0.1", "description": "WebRTC codelab", "dependencies": { "node-static": "^0.7.10", "socket.io": "^1.2.0" } }
This is an app manifest that tells Node Package Manager (npm
) what project dependencies to install.
To install dependencies (such as /socket.io/socket.io.js
), run the following from the command line terminal, in your work directory:
============================================================================================
HTML 파일에서 Socket.IO 파일을 사용하고있는 것을 보았을 수 있습니다.
<script src = "/ socket.io/socket.io.js"> </ script>
작업 디렉토리 의 최상위 레벨 에서 다음 내용으로 package.json 파일을 작성 하십시오 .
{ "name": "webrtc-codelab", "version": "0.0.1", "description": "WebRTC codelab", "dependencies": { "node-static": "^ 0.7.10", "socket .io ":"^ 1.2.0 " } }
이 패키지는 노드 패키지 관리자 ( npm
)에게 어떤 프로젝트 종속성을 설치할 것인지 알려주는 응용 프로그램 목록입니다 .
종속성 (예 :)을 설치하려면 작업 디렉토리 /socket.io/socket.io.js
의 명령 행 터미널에서 다음을 실행하십시오 .
npm 설치
다음과 같이 끝나는 설치 로그가 나타납니다.
=============================================================================================
==============================================================================================
Node js 로 소켓 인풋 아웃풋 설정 중인데 작업하는 폴더에 가서 (json 과 js 파일 있는곳) npm install 명령어를 치라는건지.... /socket.io/socket.io.js
경로로 가서 명령 행 터미널에서 다음을 실행하라는데... 저줄이 도무지 이해가 안갑니다 node js 처음 접해봐서 3일정도 막혀있는데 도와주세요 ㅠㅠㅠㅠㅠ
=============================================================================================
명의 애들엄마
금잔디
똥닌겐와타시의
똥닌겐와타시의
"dependencies": { }에 쓸 모듈 적어두고 json 파일있는 곳 cmd 경로 설정 해주고 npm install 하면 적힌 모듈 다 받아주는 걸로 알고 있엉
금잔디
syntaxError