이동 전단 개발 디 버 깅 환경 설정 (nodejs + npm + weiner 설치 및 설정 사용)
8096 단어 nodejs
nodeJS 환경 을 기반 으로 한 것 이기 때문에 이전에 그것 을 해 본 적 이 없 기 때문에 메 모 를 해 보 세 요.
노드 환경 설정
Node. js 설치 가 편리 합 니 다. 다운로드 페이지 를 엽 니 다.https://nodejs.org/#download, 직접 설치 단 추 를 누 르 면 다운 로드 를 알려 줍 니 다. 완료 후 next 로 가면 됩 니 다. 설치 가 완료 되면 먼저 설치 성공 여 부 를 확인 해 야 합 니 다.
1. 실행 중 cmd 입력
2. 명령 프롬프트 에 node - v 입력
결 과 는 다음 과 같다.
C:\Users\Administrator>node -v
v0.12.2
node 설치 성공 설명
3. 명령 프롬프트 에 npm - v 입력
결 과 는 다음 과 같다.
C:\Users\Administrator>npm -v
2.7.4
설명
4. npm 설치 기능 테스트, 입력 C: \ \ Users \ \ Administrator > npm install express - g, 설치 express 다운로드 대기
메모: node 를 설치 한 후 설치 디 렉 터 리 의 보안 권한 을 쓰기 가능 하고 수정 가능 한 것 으로 설정 해 야 합 니 다. 그렇지 않 으 면 npm 로 다른 패 키 지 를 설치 하 는 데 성공 하지 못 할 수도 있 습 니 다. node 디 렉 터 리 에 두 개의 디 렉 터 리 'node cache', 'node global' 을 만 들 수 있 기 때 문 입 니 다. 물론 두 개의 디 렉 터 리 를 직접 만 들 고 권한 을 설정 할 수도 있 습 니 다.
결과 되 돌리 기:
C:\Users\Administrator>npm install express -g
[email protected] C:\Program Files
odejs
ode_global
ode_modules\express
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected])
방금 설 치 된 express 테스트
1. 노드 를 입력 하여 노드 진입
2. require ('express') 를 입력 하고 다음 결 과 를 되 돌려 설치 성공 을 설명 합 니 다.
메모: 위의 명령 을 실행 하기 전에 필요 합 니 다.
환경 변수 대화 상자 에 들 어가 시스템 변수 에서 새로 만 듭 니 다. "
NODE PATH ", 입력"
C: \ Program Filesodejsode globalode modules "라 는 단 계 는 상당히 중요 합 니 다.
위의 사용자 변 수 는 다음 과 같이 변경 해 야 합 니 다. (사용자 변수 "PATH" 는 "C: \ Program Filesodejsode global \" 로 변경 되 었 습 니 다. module 을 사용 하지 않 을 때 입력 명령 에 "xxx 는 내부 나 외부 명령 이 아니 며 실행 가능 한 프로그램 이나 일괄 처리 문서 가 아 닙 니 다" 라 는 오류 가 발생 할 수 있 습 니 다.
{ [Function: createApplication]
application:
{ init: [Function],
defaultConfiguration: [Function],
lazyrouter: [Function],
handle: [Function],
use: [Function: use],
route: [Function],
engine: [Function],
param: [Function],
set: [Function],
path: [Function],
enabled: [Function],
disabled: [Function],
enable: [Function],
disable: [Function],
checkout: [Function],
connect: [Function],
copy: [Function],
delete: [Function],
get: [Function],
head: [Function],
lock: [Function],
'm-search': [Function],
merge: [Function],
mkactivity: [Function],
mkcol: [Function],
move: [Function],
notify: [Function],
options: [Function],
patch: [Function],
post: [Function],
propfind: [Function],
proppatch: [Function],
purge: [Function],
put: [Function],
report: [Function],
search: [Function],
subscribe: [Function],
trace: [Function],
unlock: [Function],
unsubscribe: [Function],
all: [Function],
del: [Function],
render: [Function],
listen: [Function] },
request:
{ header: [Function],
get: [Function],
accepts: [Function],
acceptsEncodings: [Function],
acceptsEncoding: [Function],
acceptsCharsets: [Function],
acceptsCharset: [Function],
acceptsLanguages: [Function],
acceptsLanguage: [Function],
range: [Function],
param: [Function: param],
is: [Function],
protocol: [Getter],
secure: [Getter],
ip: [Getter],
ips: [Getter],
subdomains: [Getter],
path: [Getter],
hostname: [Getter],
host: [Getter],
fresh: [Getter],
stale: [Getter],
xhr: [Getter] },
response:
{ status: [Function],
links: [Function],
send: [Function: send],
json: [Function: json],
jsonp: [Function: jsonp],
sendStatus: [Function: sendStatus],
sendFile: [Function: sendFile],
sendfile: [Function],
download: [Function: download],
type: [Function],
contentType: [Function],
format: [Function],
attachment: [Function: attachment],
append: [Function: append],
header: [Function: header],
set: [Function: header],
get: [Function],
clearCookie: [Function],
cookie: [Function],
location: [Function],
redirect: [Function: redirect],
vary: [Function],
render: [Function] },
Route: [Function: Route],
Router:
{ [Function]
param: [Function: param],
handle: [Function],
process_params: [Function],
use: [Function: use],
route: [Function],
checkout: [Function],
connect: [Function],
copy: [Function],
delete: [Function],
get: [Function],
head: [Function],
lock: [Function],
'm-search': [Function],
merge: [Function],
mkactivity: [Function],
mkcol: [Function],
move: [Function],
notify: [Function],
options: [Function],
patch: [Function],
post: [Function],
propfind: [Function],
proppatch: [Function],
purge: [Function],
put: [Function],
report: [Function],
search: [Function],
subscribe: [Function],
trace: [Function],
unlock: [Function],
unsubscribe: [Function],
all: [Function] },
query: [Function: query],
static:
{ [Function: serveStatic]
mime:
{ types: [Object],
extensions: [Object],
default_type: 'application/octet-stream',
Mime: [Function: Mime],
charsets: [Object] } } }
>
이로써 node 환경 설치 설정 이 완료 되 었 습 니 다.
weinre 설치 설정
1. express 를 설치 하 는 방식 에 따라 명령 프롬프트 에 입력:
C:\Users\Administrator>npm install weinre -g
돌아 가기:
C:\Program Files
odejs
ode_global\weinre -> C:\Program Files
odejs
ode_globa
l
ode_modules\weinre\weinre
[email protected] C:\Program Files
odejs
ode_global
ode_modules\weinr
e
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
C:\Users\Administrator>
설치 성공
2. weinre 실행
C:\Users\Administrator>weinre --boundHost -all-
2015-04-23T02:29:10.030Z weinre: starting server at http://localhost:8080
3. 브 라 우 저 로 검증
브 라 우 저 주소 표시 줄 에 입력:http://localhost:8080/실행 성공 을 설명 하 는 weinre 의 정 보 를 볼 수 있 습 니 다.
4. 디 버 깅 정 보 를 설정 하고 디 버 깅 할 페이지 에서 참조:http://localhost:8080/target/target- script - min. js \ # anonymous, 아래 와 같 습 니 다.
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1 maximum-scale=1, user-scalable=no">
<title> </title>
<script src="http://10.11.48.103:8080/target/target-script-min.js#anonymous"></script>
</head>
localhost 를 weinre 를 실행 하 는 호스트 IP 로 바 꿔 야 합 니 다. 그렇지 않 으 면 접근 할 수 없습니다.
5. weinre 홈 페이지 에서 클릭 "http://localhost:8080/client/#anonymous"디 버 깅 도구 인터페이스 에 들 어 갔 어 요."
나머지 는 Firebug 처럼 편 해 졌어 요.
마지막 으로 한 마디 하 자 면 weinre 를 실행 하 는 명령 프롬프트 창 이 계속 실행 되 고 있 습 니 다. 그렇지 않 으 면 weinre 서비스 에 접근 할 수 없고 디 버 깅 도 할 수 없습니다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Node.js를 AWS서버에서 사용하는 실습간단한 예제와 함께 AWS에서 Node.js를사용하는 법을 배워보도록 하겠다. 해당 github에 있는 레포지토리로 사용을 할 것이다. 3000번 포트로 Listen되는 예제이고 간단히 GET, POST, DELET...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.