env:节点:少编译时,在phpstorm中没有这样的文件或目录 [英] env: node: No such file or directory in phpstorm when compiling less

查看:100
本文介绍了env:节点:少编译时,在phpstorm中没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用phpstorm将 main.less 文件编译为 main.css 文件.但是,出现此错误, .less 文件无法编译.

I'm trying to compile my main.less file to a main.css file using phpstorm. However, I'm getting this error and the .less file does not compile.

/usr/local/bin/lessc main.less
env: node: No such file or directory

Process finished with exit code 127

我正在使用Mac,不确定为什么会这样.之前它运行良好,但是我重新启动了计算机,现在出现此错误.

I'm using a mac and not sure why this is happening. It was working fine before, but I restarted my computer and now I'm getting this error.

有人知道为什么会这样以及如何解决吗?

Does anyone know why this is happening and how to fix?

推荐答案

似乎在您的PATH中找不到节点.PHPStorm通常使用您的环境变量来确定工具位置.但是在MacOSX上,GUI应用程序之间和终端内部的环境变量有所不同.PHPStorm通过在启动时执行以下命令来尝试在启动时加载终端环境:

Seems Node is not found in your PATH. PHPStorm normally uses your environment variables to figure out tools locations. But on MacOSX the environment variables differ between GUI applications and within the terminal. PHPStorm tries to load terminal environment on startup by executing the following command on startup:

-l -i -c'/Applications/PHPStorm.app/bin/printenv.py'

-l -i -c '/Applications/PHPStorm.app/bin/printenv.py'

似乎此命令失败或无法检索所有需要的东西.从系统终端(打开-a/Applications/PHPStorm.app)运行PHPStorm时,能否检查问题是否仍然存在?还有一件事要检查:请打开较少文件观察器"设置,在环境变量"字段中按省略号按钮以查看变量-是否启用了包括父级环境变量"?如果禁用此选项,则文件观察者将无法使用系统环境变量

Seems this command either fails or can't retrieve all needed stuff. Can you check if the problem persists when running PHPStorm from system terminal (open -a /Applications/PHPStorm.app)? And one more thing to check: please open your Less file watcher settings, press ellipsis button in 'Environment variables' field to view variables - do you have 'Include parent environment variables' enabled? If this option is disabled, system environment variables won't be available to file watcher

这篇关于env:节点:少编译时,在phpstorm中没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆