2017-02-17 40 views
1

我在使用nodejs,http-server,gulp和括號的windows上開發了一個角度應用程序。在Windows中,我有一個根目錄(lms)包含:將angularjs應用程序從Windows移動到Ubuntu

/src 
/src/templates 
/src/js 
/src/img 
/src/index.html 
/node_modules 
package.json 

在Ubuntu中,我有一個名爲/ home/lms的目錄。我已經安裝了nodejs,angularjs和http-server,但沒有吞嚥或涼爽,因爲我不會在Ubuntu中進行開發。我在家中看到/ lms:

/Public 
/Templates 
/Pictures 
/node_modules 

如何部署我的文件?我假設我將package.json放在home/lms中,但是我無法將Windows node_modules複製到Ubuntu node_modules,因此如何爲Ubuntu創建node_modules?

另外,我是否將我的應用程序目錄/ src放到Ubuntu的/ home/lms/Public目錄中,或者只是將它添加到/ home/lms?

+0

好的,所以我可以直接從Windows部署到Ubuntu,並使用git作爲備份。好的,我會在gulp deploy上看看這個:http://mikeeverhart.net/2016/01/deploy-code-to-remote-servers-with-gulp-js/ – lymantok

回答

2

如果應用程序明智完成,它應該部署任務捆綁一切。你不需要在服務器端有node_modules,但是如果你真的想這樣做,你必須在package.json所在的文件夾中運行npm install。

+0

對。 package.json文件是用於構建node_modules的配方。你永遠不需要移動或備份該目錄。 – isherwood

相關問題