我使用這個模塊,我對Openshift應用程序,但在需要執行來檢查,如果一個文件中的數據文件夾中存在的功能appers錯誤:FS的NodeJS模塊不Openshift
DEBUG: /var/lib/openshift/02A50df2XXYD46273d00FFG8/app-root/runtime/repo/server.js:164
fs.exists('$OPENSHIFT_HOMEDIR/app-root/data/' + user_ip, function(exis
^
DEBUG: TypeError: Object #<Object> has no method 'exists'
我有需要在服務器代碼fs,並且在的package.json的依賴關係
編輯:解決
使用require('path')
和path.exists()
它工作得很好。
我試過使用path.exists,但是當函數執行時它返回下一個錯誤:path.exists('$ OPENSHIFT_HOMEDIR/app-root/data /'+ user_ip,function(exists) DEBUG:ReferenceError:path is not定義 – abaracedo