【问题标题】:Installing node-sass errors with 'ELIFECYCLE'使用“ELIFECYCLE”安装 node-sass 错误
【发布时间】:2018-12-01 16:53:43
【问题描述】:

我安装了 npm 并且可以工作,但是我无法安装 node-sass。下一条消息如下;

npm ERR! Linux 4.15.0-39-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "scss"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! one@1.0.0 scss: `node-sass -watch scss -o css`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the one@1.0.0 scss script 'node-sass -watch scss -o css'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the one package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-sass -watch scss -o css
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs one
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls one
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/maty/Desktop/MyFirstProyect/npm-debug.log

我安装 sass 使用;

npm install node-sass sudo npm install -g sass

我检查了版本,我做了一个简单的 sass 代码示例。

有人,你能帮帮我吗?

【问题讨论】:

  • 我相信你安装 sass 不正确,你安装 Ruby 了吗?

标签: node.js npm node-sass


【解决方案1】:

检查您的节点版本和 node-sass 版本。 我的是 "node-sass":"4.5.3" 节点版本我也改变了 "node-sass":"^4.6.0" 在 package.json 开发依赖项中(根据您的节点版本通过参考下面的附加图像更改此设置)并运行 npm install。安装成功并且工作正常。试试这个

【讨论】: