yum install -y nodejs 한 다음 yum install -y npm 하면 npm 패키지 설치하면서 기존에 설치된 nodejs 패키지랑 충돌나서 npm 설치가 안됨
file /usr/lib/node_modules/npm/node_modules/ini from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/init-package-json from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/lockfile from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/npm-user-validate from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/once from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/opener from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/read from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/sha from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/retry conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/rimraf conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/semver conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/sha conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/slide conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/tar conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/uid-number conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/node_modules/which conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
file /usr/lib/node_modules/npm/package.json conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
이런식으로 충돌납니다. 위와같이 충돌나면 rpm -qa | grep node 해서 나온거 삭제해주고
npm 패키지 안에 nodejs 도 들어있으니까 nodejs 설치할필요없이 npm만 yum으로 설치해주면 됨
그다음 npm install socket.io 하면
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/socket.io
npm ERR! Error: CERT_UNTRUSTED
npm ERR! at SecurePair. (tls.js:1370:32)
npm ERR! at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR! at SecurePair.maybeInitFinished (tls.js:982:10)
npm ERR! at CleartextStream.read [as _read] (tls.js:469:13)
npm ERR! at CleartextStream.Readable.read (_stream_readable.js:320:10)ㄴ
이런식으로 에러 난다.
https 인증 어쩌구 저쩌구 하는데
npm config set strict-ssl false
인증 우회 하고 다시 npm install socket.io 설치하면
/usr/lib/node_modules/socket.io/usr/lib/node_modules/socket.io]# pwd
/usr/lib/node_modules/socket.io
/usr/lib/node_modules/socket.io]# ll
total 48
drwxr-xr-x 2 root root 4096 2019-04-10 09:50 lib
drwxr-xr-x 8 root root 4096 2019-04-10 09:50 node_modules
-rw-r--r-- 1 root root 18733 2019-04-10 09:50 package.json
-rw-r--r-- 1 root root 16588 1985-10-26 17:15 Readme.md
잘 설치됐다.
'job > linux' 카테고리의 다른 글
서버 점검.. (0) | 2019.06.11 |
---|---|
centos 5 yum error (0) | 2019.04.29 |
ionice (1) | 2019.04.09 |
strace debug (0) | 2019.02.21 |
php-fpm 메모리 사용률 확인하고 튜닝하기 (2) | 2019.02.20 |