Ubuntu 18.04 npm install got error EMISSINGARG / 우분투18.04 nodejs npm install 에러

 As I setup ubuntu 18.04 and node app server, I found that funny error as follows:

when I install nodejs and npm with apt. 

It shows error msg like EMISSINGARG.

npm ERR! Linux 4.15.0-139-generic

npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"

npm ERR! node v8.10.0

npm ERR! npm v3.5.2

npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1

npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)

npm ERR! typeerror     at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)

npm ERR! typeerror     at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)

npm ERR! typeerror     at /usr/share/npm/lib/install/deps.js:457:7

npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50

npm ERR! typeerror     at /usr/share/npm/lib/fetch-package-metadata.js:37:12

npm ERR! typeerror     at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)

npm ERR! typeerror     at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)

npm ERR! typeerror     at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)

npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50

npm ERR! typeerror This is an error with npm itself. Please report this error at:

npm ERR! typeerror     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request

npm ERR!     /home1/ncloud/app/mirecoDBnode/npm-debug.log

So, I googled it and found that error happens when either node version or npm version is too old for now. 

Finally, I upgrade node and npm as follows:

$> sudo apt remove nodejs

$> curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -

$> sudo apt-get install nodejs

$> sudo npm intall -g npm@latest

Then it works like a charm. 

-------------------------------

우분투 18.04 이미지에서 apt로 nodejs와 npm설치후에 npm install  에러날때. 

nodejs : 8.10 / npm: 3.5.2 일경우에 생기는 문제로 nodejs는 현재 14버젼이 설치되는데 apt에 있는 node와 npm이 너무 예전 버젼이라 생기는 문제. 새로 node관련해서 apt리포짓에 추가해주고, 새버젼을 설치하면 되고, npm은 최신버젼을 자체적으로 설치하면 문제 해결.(npm업그레이드를 위해서 dependency가 node가 13.x이상이라 node먼저 업그레이드해주는거를 추천) 


Comments

Popular posts from this blog

[VS2010][VS2015] "stdafx.h 을 포함 소스를 찾을 수 없습니다" 에러 해결법