본문 바로가기

오늘의 오류들/ubuntu

[ubuntu20.04 .anaconda, npm 오류]: Attempting to bind to HOST environment variable: x86_64-conda_cos6-linux-gnu , Could not find an open port , get addrinfo EAI_AGAIN

실행환경:ubuntu20.04 lts


npm을 실행하려는데 이런 오류가 떴습니다.디버그 로그를 살펴보니

 

 

[npm run start errror]

 

[debug_log]

 

그래서 스택오버플로우를 찾아본 결과 가상환경 자동활성화 기능을 해제하면 문제가 해결된다고 합니다.

 

출처: https://stackoverflow.com/questions/54429210/how-do-i-prevent-conda-from-activating-the-base-environment-by-default

 

 

$ conda config --set auto_activate_base false

 

이렇게 입력하고 다시 터미널을 켜서 서버를 작동하면 잘됩니다.터미널 앞부분에 (base)라고 적힌 부분이 없어진 것을 확인할 수 있다.

 

home의 .condarc를 보면 하단 부분에 auto_activate_base: fasle라고 되어있는것을 볼 수 있습니다.(적용됨)

 

아래 링크는 제가 스택오버플로에 올린 건데, 과정은 똑같고 node 버전이나 host등 기타 정보가 궁금하시면 보면

될 것 같습니다.

 

stackoverflow.com/questions/66881128/npm-run-start-error-anacondaenvironmental-variable-ubuntu20-04-attempting-to-b

 

npm run start error anaconda:environmental variable ubuntu20.04 :Attempting to bind to HOST environment variable x86_64-conda_co

When I start run npm start, there is error like this. [npm error screen] [Debug_log] debug log is like this [npm version & node version] This is my node version and npm version. [path] This is ...

stackoverflow.com


[실패한 방법들]

1. 환경변수 문제(이것저것 시도해봤으나 아님)

[Anaconda complier tools]

 

complier packages

 

macos는 아나콘다 버젼에 따라 clang_osx-64. clangxx_osx-64. gfortran_osx-64.로 나뉘고

linuxgcc_linux-64. gxx_linux-64. gfortran_linux-64.로 나뉜다.

 

complier build platform은 컴파일러를 실행하고 코드를 빌드하는 곳이다.

 

complier host platform은 빌드된 코드를 최종적으로 호스트하고? 실행하는 곳이다.

 

이런 패키지  이름들은 플랫폼을 식별한다? 모든 컴파일러 패키지들은 빌드 플랫폼과 호스트 플랫폼 둘다에 특화되어있다.

 

 

[Using complier packages]

 

컴파일러 패키지들은 conda와 함꼐 설치된다. 왜냐하면 컴파일러들은 cross compiling을 목적으로 설계되었기 때문이다.

(크로스 컴파일??)

 

*크로스 컴파일이란? 윈도우나 맥 같은 플랫폼에서 안드로이드나 ios 플랫폼에서도 실행가능한 파일을 만들어주는 컴파일러를 

크로스 컴파일러라고 한다.

 

그래서 컴파일러 이름앞에 수식어(prefix)가 붙는다. gcc 대신에 x86_64-conda_cos6-linux-gnu-gcc 같은 이름으로 말이다,

 

이런 긴 이름은 호스트 플래슈폼에서 잘못된 컴파일러를 사용하는 것을 방지해준다.

 

 

CMake같은 빌드툴은 환경변수를 세팅하면 gcc 같은 이름으로 찾을 수 있다.

 

conda의 activate.d 스크립트에서 이런 변수들을 세팅할 수 있다.

 

activate.d는 anaconda가 설치된 곳에서 찾을수 있다.아래와 같이

 

 

 

 

2.Could not find an open port at x86_64-conda_cos6-linux-gnu.

[etc/hosts/bash.bashrc 에 HOST="localhost" 적어넣기 혹은 bashrc에 적어넣기 둘다 효과가 없었다.]

github.com/vuejs/vue-cli/issues/4081

 

Error: getaddrinfo ENOTFOUND x86_64-conda_cos6-linux-gnu · Issue #4081 · vuejs/vue-cli

Version 3.8.2 Reproduction link https://private-repository........... Environment info System: OS: Linux 4.19 Manjaro Linux undefined CPU: (4) x64 Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz Binaries:...

github.com

이곳에 저와 비슷한 오류를 가지고 있는 사람들이 있어서 참고하였습니다.

 

한 분의 구체적인 해결책을 보고 그대로 따라했습니다. localhost설정이 제대로 되지않아서 이 설정을 제대로 해주면

해결될 것이라고 합니다.

 

 


 

 

[참고 사이트]

docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html

 

Anaconda compiler tools — conda-build 3.21.4+3.g3b99b222.dirty documentation

Anaconda 5.0 switched from OS-provided compiler tools to our own toolsets. This allows improved compiler capabilities, including better security and performance. This page describes how to use these tools and enable these benefits. Compiler packages Before

docs.conda.io

hwan-shell.tistory.com/97

 

크로스 컴파일러란? 크로스 컴파일러 설치 방법!! (도전 임베디드 OS 만들기)

크로스 컴파일러란? 다른 플렛폼에서(windows, Mac) 다른 플렛폼의(Android, IOS, Embedded) 실행 파일을 만들어 주는 컴파일러를 가르켜 크로스 컴파일러 라고 합니다. 이 무슨 말이냐?? 예를 들어 Android의

hwan-shell.tistory.com

blog.kichul.co.kr/tag/node-js-ko/

 

Node.js Archives - kichul's blog

NVM은 여러 Node.js 버전을 사용할 수 있게 하는 CLI도구다. NVM 설치하기 NVM 설치하기: # 설치하기 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash # NVM 환경 불러오기 export NVM_DIR="$HOME/

blog.kichul.co.kr

www.howtogeek.com/668503/how-to-set-environment-variables-in-bash-on-linux/

 

How to Set Environment Variables in Bash on Linux

There’s more than one type of environment variable on Linux. Learn how to see them, create them for local and remote logins, and make them survive reboots.

www.howtogeek.com

help.ubuntu.com/community/EnvironmentVariables

 

EnvironmentVariables - Community Help Wiki

Environment variables provide a way to influence the behaviour of software on the system. For example, the "LANG" environment variable determines the language in which software programs communicate with the user. Environment variables consist of names that

help.ubuntu.com

m.blog.naver.com/koromoon/220793570727

 

리눅스 환경 변수

참고 사이트 : http://www.tecmint.com/set-unset-environment-variables-in-linux/ http://originalchoi.t...

blog.naver.com

sike6054.github.io/blog/etc/fourth-post/

 

Anaconda 가상 환경 (base) 자동 활성화 해제.

1. (base)

sike6054.github.io

storycompiler.tistory.com/118

 

github.com/conda/conda/issues/7031

 

activate/deactivate changes to HOST environment variable · Issue #7031 · conda/conda

I'm submitting a... bug report feature request Current Behavior When activating an environment the HOST environment variable is set to "x86_64-conda_cos6-linux-gnu". After deactivatin...

github.com

 

 

 

 

sike6054.github.io/blog/etc/fourth-post/

 

hippogrammer.tistory.com/57