development

64 비트 또는 32 비트 노드 실행 파일이 설치되어 있는지 확인하는 방법은 무엇입니까?

big-blog 2020. 9. 23. 07:52
반응형

64 비트 또는 32 비트 노드 실행 파일이 설치되어 있는지 확인하는 방법은 무엇입니까?


내 Windows PC에는 nodejs가 설치되어 있습니다. 64 비트인지 32 비트인지 확인하고 싶습니다. 그것을 어떻게 결정할 수 있습니까? 내가 처형했다

node --help

그러나 그것은 나에게 원하는 정보를 제공 할 수있는 옵션이없는 것 같습니다.


명령 줄에서 다음을 실행합니다.

node -p "process.arch"

'arm', 'ia32'또는 'x64'를 반환합니다.


노드가 설치되어 실행 가능하면 간단히 실행할 수 있습니다.

c:\> node -p "process"    

process서식이 지정된 변수 의 내용을 볼 수 있습니다 . 거기에 키 archplatform운영 체제가 표시됩니다. 아래 예에서는Windows 7 x64

{
    title : 'Administrator: C:\\Windows\\System32\\cmd.exe - node  ',
    version : 'v0.10.36',
    moduleLoadList :
    [   'Binding evals',
        ...
        'Binding signal_wrap',
        'NativeModule string_decoder'],
    versions : {
        http_parser : '1.0',
        node : '0.10.36',
        v8 : '3.14.5.9',
        ares : '1.9.0-DEV',
        uv : '0.10.30',
        zlib : '1.2.8',
        modules : '11',
        openssl : '1.0.1l'
    },
    arch : 'x64',
    platform : 'win32',
    argv : ['node'],
    execArgv : [],
    env : {
        ALLUSERSPROFILE : 'C:\\ProgramData',
        HOMEDRIVE : 'C:',
        JAVA_HOME : 'C:\\Program Files\\Java\\jdk1.8.0_05',
        NODEJS : 'C:\\Program Files (x86)\\nodejs\\',
        NUMBER_OF_PROCESSORS : '4',
        OS : 'Windows_NT',
        Path : 'C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;',
        PATHEXT : '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY',
        PROCESSOR_ARCHITECTURE : 'AMD64',
        PROCESSOR_IDENTIFIER : 'Intel64 Family 6 Model 42 Stepping 7, GenuineIntel',
        PROCESSOR_LEVEL : '6',
        PROCESSOR_REVISION : '2a07',
        ProgramData : 'C:\\ProgramData',
        ProgramFiles : 'C:\\Program Files', 
        'ProgramFiles(x86)' : 'C:\\Program Files (x86)',
        ProgramW6432 : 'C:\\Program Files',
        PROMPT : '$P$G',
        PUBLIC : 'C:\\Users\\Public',
        PYTHON : 'C:\\Python34',
        SESSIONNAME : 'Console',
        SystemDrive : 'C:',
        SystemRoot : 'C:\\Windows',
        windir : 'C:\\Windows',
        windows_tracing_flags : '3'
    },
    features : {
        ...
    },
    config : {
        ...
    }
}

Windows OS에있는 경우 Windows 작업 관리자 를 사용하여 구식 방식으로 이동하십시오 .

내 시도는 다음과 같습니다.

node명령 프롬프트에서 실행하기 만하면 됩니다.

C:\> node

This will put node into REPL mode (indicated by > symbol). Now open Task Manager (Ctrl+Shift+Esc) to see node.exe process details. Mine is on Windows 10 64-bit with node 32-bit installed. Make sure you enable 'Platform' column to see 32-bit/64-bit information.

enter image description here


in mac

$ node
 > require('os').arch()

in windows

c:\> node
> require('os').arch()

Well the way I am suggesting is not at all a good way . You can go over to C: then go to Program Files and search nodejs folder there . If it is found then you are running 64 bit version else check on Program Files (x86) . If it is found there then you are running 32 bit version.


This likely doesn't directly solve your problem, as I don't know the best way to get the same behavior on Windows, but using the file command on a Unix or Linux system will tell you the processor architecture of an executable:

$ file `which node`
/usr/local/bin/node: Mach-O 64-bit executable x86_64

If you have Cygwin installed, I'm pretty sure that it provides a file command, or else you could check online for similar programs that work on Windows.


Just start node interpreter by running node. then in that, process.env gives a json with all the information you require. My try has a PROCESSOR_ARCHITECTURE: 'AMD64' entry in that.

I also find

ProgramFiles: 'C:\\Program Files', 'ProgramFiles(x86)': 'C:\\Program Files (x86)' ProgramW6432: 'C:\\Program Files'

참고URL : https://stackoverflow.com/questions/24956691/how-to-determine-whether-i-have-64bit-or-32-bit-node-executable-installed

반응형