尝试安装grunt-sass时,“node build.js”失败

我试图从grunt-contrib-sass切换到grunt-sass,但是我正在运行与grunt包装器模块中的node-sass相关的构build错误。 到目前为止,我已经将节点从0.10.40升级到0.12.7,并切换到Python 2.7以绕过其他一些节点,但这仍然是:

$ npm install > node-sass@1.0.3 install /var/www/html/example.com/www/node_modules/grunt-sass/node_modules/node-sass > node build.js child_process: customFds option is deprecated, use stdio instead. make: Entering directory `/var/www/html/example.com/www/node_modules/grunt-sass/node_modules/node-sass/build' CXX(target) Release/obj.target/binding/binding.o cc1plus: error: unrecognized command line option "-std=c++11" cc1plus: error: unrecognized command line option "-std=c++11" make: *** [Release/obj.target/binding/binding.o] Error 1 make: Leaving directory `/var/www/html/example.com/www/node_modules/grunt-sass/node_modules/node-sass/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12) gyp ERR! System Linux 2.6.18-274.18.1.el5.centos.plus gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /var/www/html/example.com/www/node_modules/grunt-sass/node_modules/node-sass gyp ERR! node -v v0.12.7 gyp ERR! node-gyp -v v2.0.1 gyp ERR! not ok Build failed npm ERR! Linux 2.6.18-274.18.1.el5.centos.plus npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" npm ERR! node v0.12.7 npm ERR! npm v2.11.3 npm ERR! code ELIFECYCLE npm ERR! node-sass@1.0.3 install: `node build.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass@1.0.3 install script 'node build.js'. npm ERR! This is most likely a problem with the node-sass package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node build.js npm ERR! You can get their info via: npm ERR! npm owner ls node-sass npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /var/www/html/example.com/www/npm-debug.log 

其他版本信息:

 $ node -v v0.12.7 $ node -v v0.12.7 $ npm -v 2.11.3 $ cat /etc/redhat-release CentOS release 5.11 (Final) 

在解决Node.js兼容性问题方面,我有点深究。 虽然这是在一个共享的开发环境,我愿意尝试几乎没有任何大规模的全球变化,如升级操作系统。

更新:我已经通过手动从本地node_modules文件夹中删除node-sass和node-gyp来解决此问题。 之后运行npm install运行没有错误。 我认为这些模块是从以前的尝试(在升级node.js和Python之前,最有可能的)剩下的。