ubuntu中sublime无法格式化代码

2018-06-06  本文已影响26人  一叶一华年

现象:在sublime中使用shif+ctr+h进行代码格式化失败,报错:

Node.js version in the default path is too old! Please download the latest version and specify the updated location.

这说明node.js版本比较低,需要升级版本。

在终端查看node.js版本  node -v   我当时的版本是0.10,显然好久没更新了。

更新步骤:

1:curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -

执行后会有提示:

2:执行sudoapt-getinstall-y nodejs 即可

执行完再次查看node.js版本就会发现已经升级了。

再进入sublime便可以格式化代码了。

上一篇 下一篇

猜你喜欢

热点阅读