How to install npm -g on offline server

后端 未结 10 1267
谎友^
谎友^ 2020-11-30 03:41

I need to install a \"global\" npm applications on an offline server.

It is easy to install a normal application:

npm install

and t

10条回答
  •  一生所求
    2020-11-30 04:41

    On your local machine or any machine that has internet connection, do

    npm install npm-bundle -g
    npm install forever -g
    

    Now, go to cd /usr/local/lib/node_modules/forever and do

    npm-bundle
    

    It will create a .tgz file. Now scp/ftp that .tgz file to the offline server and do

    npm install forever -g
    

    Reference: This blog

提交回复
热议问题