[英]Installing node-sass on ubuntu 18.04 returns error
I'm trying to install node-sass on ubuntu, beacuse I want to use sass-autocompile, but even when I try to compile that sass file in atom (just when I save it) It returns this error: 我正在尝试在ubuntu上安装node-sass,因为我想使用sass-autocompile,但是即使当我尝试在原子中编译该sass文件时(仅在保存时),它仍会返回此错误:
`fs.js:904
return binding.readdir(pathModule._makeLong(path), options.encoding)
Error: ENOENT: no such file or directory, scandir
'/usr/lib/node_modules/node-sass/vendor'
at Object.fs.readdirSync (fs.js:904:18)
at Object.getInstalledBinaries (/usr/lib/node_modules/node-
sass/lib/extensions.js:129:13)
at foundBinariesList (/usr/lib/node_modules/node-
sass/lib/errors.js:20:15)
at foundBinaries (/usr/lib/node_modules/node-sass/lib/errors.js:15:5)
at Object.module.exports.missingBinary (/usr/lib/node_modules/node-
sass/lib/errors.js:45:5)
at module.exports (/usr/lib/node_modules/node-sass/lib/binding.js:15:30)
at Object.<anonymous> (/usr/lib/node_modules/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)`
I tried to use this command npm rebuild node-sass
and it didn't fix the problem, even with --force
我试图使用此命令
npm rebuild node-sass
,即使使用--force
也无法解决问题
And removing nodejs and node-sass and npm and installing again didn't fix the problem and yes I do have ruby installed. 并删除nodejs和node-sass和npm并再次安装并不能解决问题,是的,我确实安装了ruby。
But one thing is really strange: this path node_modules/node-sass/vendor'
exists in home folder, basically node_modules
exists in home folder even with that vendor folder. 但是有一件事情真的很奇怪:该路径
node_modules/node-sass/vendor'
存在于主文件夹中,基本上, node_modules
即使存在该供应商文件夹中也存在于主文件夹中。 Can you help me out ? 你能帮我吗 ?
so after reading some of the workarounds on https://github.com/sass/node-sass/issues/1579 here is my suggestion 所以在阅读了https://github.com/sass/node-sass/issues/1579上的一些解决方法后,这是我的建议
first remove node_modules
directory and re-install dependencies npm install
if its still not working then 首先删除
node_modules
目录,然后重新安装依赖项npm install
如果仍然无法运行),然后
node node_modules/node-sass/scripts/install.js
npm rebuild node-sass
if it's still not working, change your node-sass
version to the latest and re-install it again 如果仍然无法正常工作,请将您的
node-sass
版本更改为最新版本,然后重新安装
Here is the solution which works for me 这是对我有用的解决方案
sudo npm install --unsafe-perm node-sass
Have a nice day all (Y). 祝您有个美好的一天。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.