2015-05-13 70 views
0

我正在嘗試安裝我的節點項目以在線運行,但是當我嘗試推送到heroku主服務器時出現錯誤。 我按照這些步驟:https://devcenter.heroku.com/articles/getting-started-with-nodejs#push-local-changes 的第一個錯誤是:Heroku找不到模塊'spawn-sync'

remote:  > node lib/install.js 
remote: 
remote:  module.js:338 
remote:   throw err; 
remote:    ^
remote:  Error: Cannot find module 'spawn-sync' 
remote:   at Function.Module._resolveFilename (module.js:336:15) 
remote:   at Function.Module._load (module.js:278:25) 
remote:   at Module.require (module.js:365:17) 
remote:   at require (module.js:384:17) 
remote:   at Object.<anonymous>  check/index.js:5:17) 

我試圖安裝DE模塊npm install spawn-sync --save和拼命地跑git add -Agit commit -m "added spawn-sync"並再次試圖git push heroku master但錯誤不斷來了。 我在一個分支工作,我在我的應用程序的根文件夾中。 有誰知道如何解決這個問題

回答

0
  1. 請確保你在主分支。如果你沒有在master上工作,你應該推到heroku上,如git push heroku branchYouAreOn:master

  2. 確保spawn-sync已列入您的package.json文件的dependencies中。

+0

感謝您的回答,它有所幫助。但我不得不使用'sudo'來使它工作。產卵同步在de依賴,忘記提及在我的問題。 –