在启动Nodejs项目时出现以下Error:
Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (57)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v3.13.1
at module.exports (/opt/care1.0.0/other_modules/nodejs/node_modules/_node-sass@3.13.1@node-sass/lib/binding.js:13:13)
at Object.<anonymous> (/opt/care1.0.0/other_modules/nodejs/node_modules/_node-sass@3.13.1@node-sass/lib/index.js:14:35)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/opt/care1.0.0/other_modules/nodejs/template_renderer/routes/index.js:9:12)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/opt/care1.0.0/other_modules/nodejs/app.js:10:14)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
error: Forever detected script exited with code: 1
然后先卸载再安装node-sass:
cnpm uninstall --save node-sass
cnpm install --save node-sass
还是出现Error:
✖ Install fail! Error: post install error, please remove node_modules before retry!
Run "sh -c node scripts/install.js" error, exit code 1
Error: post install error, please remove node_modules before retry!
Run "sh -c node scripts/install.js" error, exit code 1
at ChildProcess.proc.on.code (/home/ec2-user/nodejs/lib/node_modules/cnpm/node_modules/runscript/index.js:74:21)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
所以根据上面的提示
please remove node_modules before retry
就删除nodejs项目目录下的node_modules:
rm -rf ./node_modules
重新执行整个cnpm install
cnpm install
结果就可以了。