2016-04-28 100 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,所以你只是刷新它,同时加入新的软件包。