How to install NodeJS project locally without internet connection?

前端 未结 2 1823
庸人自扰
庸人自扰 2020-12-02 14:02

I have a project which I will have to deploy to client Windows systems where it will not be possible to connect to internet. I currently have a folder in D:\\NODE which cont

2条回答
  •  囚心锁ツ
    2020-12-02 14:20

    1 - In system with internet access install module with this command:

    npm install [module name]
    

    2 - go to %userprofile%\AppData\Roaming\npm\node_modules[module name]\ (e.g C:\Users\janson\AppData\Roaming\npm\node_modules\grunt-cli)
    3 - run npm pack
    4 - this should result in a [module name]-x.y.z.tgz file
    5 - run npm i -g [module name]-x.y.z.tgz in offline system

提交回复
热议问题