[Electron] npm, electron 설치

2019. 1. 28. 23:23· WEB/Electron
반응형

[Electron] npm, electron 설치



Electron 애플리케이션은 근본적으로 Node.js 애플리케이션이라고 할 수 있다.

그래서 Node.js 를 먼저 설치해야한다. 


1. npm 설치

- node.js 를 설치하면 npm 이 자동으로 설치된다.

- https://nodejs.org/en/download/ 접속해서 자신의 OS에 맞는 파일 다운.


- 자동으로 저장된 위치 ( mac )

This package has installed:

• Node.js v10.15.0 to /usr/local/bin/node

• npm v6.4.1 to /usr/local/bin/npm

Make sure that /usr/local/bin is in your $PATH.

- Node.js 버전을 확인.

itinerant-ui-MacBookPro:~ itinerant$ node -v
v10.15.0

- 설치가 완료되면 terminal에서 "npm"을 입력했을 경우 아래와 같이 표시되면 Path가 잘 입력된 것이다.

itinerant-ui-MacBookPro:~ itinerant$ npm

Usage: npm 

where  is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    completion, config, create, ddp, dedupe, deprecate,
    dist-tag, docs, doctor, edit, explore, get, help,
    help-search, hook, i, init, install, install-test, it, link,
    list, ln, login, logout, ls, outdated, owner, pack, ping,
    prefix, profile, prune, publish, rb, rebuild, repo, restart,
    root, run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami

npm  -h  quick help on 
npm -l            display full usage info
npm help    search for help on 
npm help npm      involved overview

Specify configs in the ini-formatted file:
    /Users/jiyeon/.npmrc
or on the command line via: npm  --key value
Config info can be viewed via: npm help config

npm@6.4.1 /usr/local/lib/node_modules/npm



2. Electron 설치

- npm을 이용해 Electron 바이너리 버전을 설치. 

- 앱에서 Electron을 설치할 때는 개발 의존성 모드( --save-dev )로 설치할 것을 권장.

itinerant-ui-MacBookPro:~ itinerant$ npm install electron --save-dev

> electron@4.0.2 postinstall /Users/jiyeon/node_modules/electron
> node install.js

Downloading tmp-825-1-SHASUMS256.txt-4.0.2
[============================================>] 100.0% of 4.74 kB (4.74 kB/s)
npm WARN saveError ENOENT: no such file or directory, open '/Users/jiyeon/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/jiyeon/package.json'
npm WARN jiyeon No description
npm WARN jiyeon No repository field.
npm WARN jiyeon No README data
npm WARN jiyeon No license field.

+ electron@4.0.2
added 145 packages from 137 contributors and audited 201 packages in 130.718s
found 0 vulnerabilities


※ 추가

electron 설치시 아래와 같이 Permission denied가 뜰 때가 있다.

오류 메세지


sudo 를 붙여서 명령어를 실행해도 Permission denied가 표시된다.

이럴 경우, "--unsafe-perm" 옵션을 추가하여 명령어를 실행하면 된다.

sudo npm install -g electron --unsafe-perm=true.








참고 : 설치|Electron

반응형
저작자표시 비영리 변경금지 (새창열림)

'WEB > Electron' 카테고리의 다른 글

[Electron] Dialog  (0) 2019.02.21
[Electron] 서버에 데이터 전송(통신)하는 방법 - ipc  (1) 2019.02.20
[Electron] 코드 변경시 자동 새로고침 되도록 설정하는 방법  (0) 2019.02.14
[Electron] Developer Tool 개발자 도구 활성화 방법  (0) 2019.02.11
[Electron] 앱 시작하기  (0) 2019.01.28
'WEB/Electron' 카테고리의 다른 글
  • [Electron] 서버에 데이터 전송(통신)하는 방법 - ipc
  • [Electron] 코드 변경시 자동 새로고침 되도록 설정하는 방법
  • [Electron] Developer Tool 개발자 도구 활성화 방법
  • [Electron] 앱 시작하기
S0PH1A
S0PH1A
반응형
S0PH1A
Web Programmer
S0PH1A
전체
오늘
어제
  • 전체
    • About Me
    • Python
      • Python
      • Django
    • DataBase
      • MySQL
      • MongoDB
    • JAVA
      • JAVA
      • Spring
    • WEB
      • JavaScript
      • HTML
      • CSS
      • Vue.js
      • React
      • Nest.js
      • Node.js
      • Electron
      • PHP
    • Linux
    • Algorithm
    • 기타
    • 생각
    • App
      • ReactNative

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • nodejs
  • mysql
  • install
  • vue
  • electron
  • javascript
  • django
  • Error
  • Python
  • vue.js

최근 댓글

최근 글

hELLO · Designed By 정상우.v4.2.2
S0PH1A
[Electron] npm, electron 설치
상단으로

티스토리툴바

개인정보

  • 티스토리 홈
  • 포럼
  • 로그인

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.