2016-04-28 99 views
5

我試圖在我的Sails應用程序中安裝node-odbc程序包(https://github.com/wankdanker/node-odbc)。在Sails應用程序中運行npm install odbc會產生錯誤?

按照該文檔我已經安裝並在服務器上配置unixobdc但是當我做NPM應用程序目錄我碰到下面的錯誤安裝ODBC --save

npm ERR! Linux 3.19.0-58-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "odbc" "--save" npm ERR! node v4.4.3 npm ERR! npm v3.8.7

npm ERR! Cannot set property 'waterline-criteria' of undefined npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! *LINK{//github.com/npm/npm/issues} npm ERR! Linux 3.19.0-58-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "odbc" "--save" npm ERR! node v4.4.3 npm ERR! npm v3.8.7

npm ERR! Cannot set property 'waterline-cursor' of undefined npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! *LINK{//github.com/npm/npm/issues} npm ERR! Linux 3.19.0-58-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "odbc" "--save" npm ERR! node v4.4.3 npm ERR! npm v3.8.7

npm ERR! Cannot set property 'waterline-errors' of undefined npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! *LINK{//github.com/npm/npm/issues}

npm ERR! Please include the following file with any support request: npm ERR! /var/www/sails.dev/secApp/npm-debug.log

爲什麼任何想法這是或如何讓這個軟件包在Sails中工作?

回答

2

試試這個:

刪除應用程序目錄中的node_modules文件夾。

從你的應用程序目錄中運行以下兩條命令:

npm install; 

npm install odbc --save; 

我懷疑了毛病與您的應用程序安裝NPM,所以你只是刷新它,同時加入新的軟件包。