BeagleBone Black의 Ubuntu.04.1 Eclipse Orion 설치
Eclipse Orion 설치
Node.js와 npm의 버전을 확인하십시오.
$ node -v
v0.10.25
$ npm -v
1.3.10
CERT_NOT_YET_VAID 오류 발생
npm에서 오리온을 설치할 때
CERT_NOT_YET_VALID
에 오류가 발생했습니다.$ npm install orion --production
npm http GET https://registry.npmjs.org/orion
npm http GET https://registry.npmjs.org/orion
npm http GET https://registry.npmjs.org/orion
npm ERR! Error: CERT_NOT_YET_VALID
npm ERR! at SecurePair.<anonymous> (tls.js:1370:32)
npm ERR! at SecurePair.EventEmitter.emit (events.js:92:17)
...
ntpdate로 시간 조정
CERT_NOT_YET_VAID 오류는 시간이 겹치지 않을 때 발생합니다.BeagleBone Black에 배터리가 탑재되어 있지 않기 때문에 전원을 연결하지 않으면 시스템 시계가 이동합니다.tapdate를 진행하여 시스템 시계의 시간을 조정합니다.
$ sudo ntpdate -b -s -u pool.ntp.org
설치 및 시작
다시 설치합니다.
$ npm install orion --production
npm start
Orion 서버를 시작합니다.$ npm start orion
> [email protected] start /home/ubuntu/node_modules/orion
> node server.js
Could not find npm in the following locations:
/usr/bin/../lib/node_modules/npm/bin/npm-cli.js
/usr/bin/./node_modules/npm/bin/npm-cli.js
Please add or modify the npm_path in the orion.conf file and restart the server.
Using workspace: /home/ubuntu/node_modules/orion/.workspace
Listening on port 8081...
브라우저에서 Orion의 시작을 확인합니다.Eclise Orion
Orion 데모
Orion 프로세스를 일시 중지합니다.pm2에 프로그램을 등록하는 스크립트를 실행합니다.
~/pm2_orion.sh
#!/bin/bash
read -d '' my_json <<_EOF_
{
"name" : "orion",
"script" : "/home/ubuntu/node_modules/orion/server.js"
}
_EOF_
echo $my_json | pm2 start -
pm2가 시작되면 Cloud9이 시작됩니다.$ chmod u+x pm2_orion.sh
$ ./pm2_orion.sh
[PM2] Process launched
┌──────────┬────┬──────┬──────┬────────┬───────────┬────────┬────────────┬──────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼──────┼──────┼────────┼───────────┼────────┼────────────┼──────────┤
│ orion │ 1 │ fork │ 1898 │ online │ 0 │ 0s │ 4.117 MB │ disabled │
└──────────┴────┴──────┴──────┴────────┴───────────┴────────┴────────────┴──────────┘
Use `pm2 info <id|name>` to get more details about an app
OS를 다시 시작하면pm2에 등록된 프로세스를 시작하기 위해 init 스크립트를 만듭니다.$ sudo pm2 startup ubuntu -u ubuntu
$ sudo /etc/init.d/pm2-init.sh restart
init 스크립트가 생성된 경우 OS가 재부팅된 후 프로세스가 저장됩니다.$ sudo pm2 save
[PM2] Dumping processes
hello world
화면 편집
간단한 노드.js 스크립트를 만들고 실행합니다.
Editor에서 "hello"폴더를 만듭니다.
world.js
console.log("hello world");
오리온은 JavaScript의 유효성 검사 및 구문 검사에를 사용합니다.화면 마법사에 eslint-env 지시를 추가합니다.world.js
/*eslint-env node */
console.log("hello world");
스크린
왼쪽 메뉴에서 셸을 선택합니다.화면 아래의 콘솔에서 만든 스크립트를 실행합니다.
» node start hello.js
ESLint
Reference
이 문제에 관하여(BeagleBone Black의 Ubuntu.04.1 Eclipse Orion 설치), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/masato/items/59f73ae28683a5af95ea텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)