V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
ooTwToo
V2EX  ›  问与答

CentOS 下 安装 PM2 问题,求指教!

  •  1
     
  •   ooTwToo · Oct 23, 2015 · 5536 views
    This topic created in 3841 days ago, the information mentioned may be changed or developed.
    # npm install -g pm2
    npm WARN optional dep failed, continuing [email protected]
    /usr/local/software/node-v4.2.1-linux-x86/bin/pm2 -> /usr/local/software/node-v4.2.1-linux-x86/lib/node_modules/pm2/bin/pm2
    /usr/local/software/node-v4.2.1-linux-x86/bin/pm2-dev -> /usr/local/software/node-v4.2.1-linux-x86/lib/node_modules/pm2/bin/pm2-dev
    [email protected] /usr/local/software/node-v4.2.1-linux-x86/lib/node_modules/pm2
    ?..?€ [email protected]
    ?..?€ [email protected]
    ?..?€ [email protected]
    ?..?€ [email protected]
    ?..?€ [email protected]
    ?..?€ [email protected]
    ?..?€ [email protected]
    ?..?€ [email protected] ([email protected])
    ?..?€ [email protected] ([email protected])
    ?..?€ [email protected]
    ?..?€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
    ?..?€ [email protected] ([email protected])
    ?..?€ [email protected] ([email protected])
    ?..?€ [email protected] ([email protected])
    ?..?€ [email protected] ([email protected])
    ?..?€ [email protected]
    ?..?€ [email protected] ([email protected], [email protected])
    ?..?€ [email protected] ([email protected])
    ?..?€ [email protected] ([email protected])
    ?..?€ [email protected] ([email protected])
    ?..?€ [email protected]
    ?..?€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
    ?..?€ [email protected] ([email protected])
    ?..?€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
    ?..?€ [email protected]
    
    Error: language "linux" is not supported

    然后 输入指令: mp2

    -bash: pm2: command not found
    

    求指教!
    PS: 使用 PM2 是用来实现 Node.js 程序永久后台

    5 replies    2015-10-23 09:38:32 +08:00
    ooTwToo
        1
    ooTwToo  
    OP
       Oct 23, 2015
    wsph123
        2
    wsph123  
       Oct 23, 2015
    Kuro
        3
    Kuro  
       Oct 23, 2015
    在 PATH 中加上 /usr/local/software/node-v4.2.1-linux-x86/bin/pm2 应该就没问题了。
    Kuro
        4
    Kuro  
       Oct 23, 2015
    噢,纠正一下,是 /usr/local/software/node-v4.2.1-linux-x86/bin/
    ooTwToo
        5
    ooTwToo  
    OP
       Oct 23, 2015
    @Kuro 谢谢前辈! 是 软连接的锅。

    在 /etc/profile 加上就 OK 了

    #set for nodejs
    export NODE_HOME=/usr/local/software/node-v4.2.1-linux-x86
    export PATH=$NODE_HOME/bin:$PATH
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3592 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 113ms · UTC 04:45 · PVG 12:45 · LAX 21:45 · JFK 00:45
    ♥ Do have faith in what you're doing.