使用“ ELIFECYCLE”安装节点无效错误

时间:2018-12-01 16:53:44

标签: node.js npm node-sass

我安装了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安装node-sass sudo npm install -g sass

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

有人,你能帮我吗?

1 个答案:

答案 0 :(得分:0)

检查您的节点版本和node-sass版本。 我的是“ node-sass”:“ 4.5.3” 节点版本,我也更改了“ node-sass”:“ ^ 4.6.0” (请参考以下附件图像,根据您的节点版本对此进行更改),位于package.json dev依赖项中,并运行npm install。安装成功并且可以正常工作。 enter image description here