无法在MacOS上启动NPM服务,Intellij ultimate on Vuejs项目
我未能启动npm服务
at run/debug Configuration 在Intellij中。
但是,在Intellij或Plain Console Works中在终端中单独进行操作。
发生了什么事?如何解决这个问题?
这是 run 控制台所示:
/usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js run serve --scripts-prepend-node-path=auto
> [email protected] serve
> node_modules/.bin/vue-cli-service serve
env: node: No such file or directory
Process finished with exit code 127
运行命令之前提到的
/usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js run serve --scripts-prepend-node-path=auto
如在终端上 那样;即使在Intellij中。
在 Intellij/perionces .../语言& frameworks/node.js和npm 节点解释器设置为/usr/usr/local/bin/node USR/local/lib/node_modules/npm 它们都存在。
碎片正在发生什么?
我很想对整个事情有更深入的了解,并感谢人们对此的任何见解的看法。
I am failing to start npm serve
at Run/Debug Configuration in IntelliJ.
But doing it separately in Terminal within IntelliJ or on plain console works.
What's going on? How to solve that?
Here's what the Run console shows:
/usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js run serve --scripts-prepend-node-path=auto
> [email protected] serve
> node_modules/.bin/vue-cli-service serve
env: node: No such file or directory
Process finished with exit code 127
As mentioned before running the command
/usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js run serve --scripts-prepend-node-path=auto
on a terminal will properly work; even in IntelliJ.
At IntelliJ/Preferences.../Languages & Frameworks/Node.js and NPM the Node interpreter is set to /usr/local/bin/node and the Package manager is set to /usr/local/lib/node_modules/npm They both do exist.
What the frag is going on?
I would love to get a deeper understanding of the whole thing and do appreciate any inseide views on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题是
节点
不在您的$ path
上;在MacOSX上,环境变量在GUI应用之间和终端内部有所不同。终端环境仅适用于从终端开始的应用程序。为了解决这个问题,Idea试图通过在启动时执行一些脚本来加载终端环境,但是似乎在您的情况下它无法检索所有需要的东西 - 因此问题。作为解决方法,您可以尝试启动IDEA 来自终端。
您可能会发现一些有用的链接: http:// 。 http://apple.stackexchange.com/questions/51677/51677/how-to-set-path-path-path-path-path-for-for-for-for--for-find-find--fin--for-for--find-launch-.plications-. 。问题在于,在Mac上定义整个系统环境变量的方法从一个版本变为另一个版本(即使是次要的系统更新也可能会破坏您的环境)
The issue is that
node
is not on your$PATH
; on MacOSX the environment variables differ between GUI applications and within the terminal. Terminal environment is only available to applications started from terminal.To solve this problem, IDEA tries to load terminal environment by executing some scripts on startup, but it seems that it can't retrieve all needed stuff in your case - thus the issue. As a workaround, you can try starting IDEA from terminal.
Some links you may find useful: http://apple.stackexchange.com/questions/106355/setting-the-system-wide-path-environment-variable-in-mavericks, http://apple.stackexchange.com/questions/51677/how-to-set-path-for-finder-launched-applications.. The problem is that the way to define system-wide environment variables on Mac changes from one version to another (even minor system updates may break your environment)
AS lena 回答,确实有帮助。感谢您的帮助!
从终端开始工作。
就我而言,我构建了一个入门脚本,
我正在运行Intellij的最终版本。 CE版本确实有另一个开始途径!
接下来的两件事将是
如果有人可以提供帮助,请继续! - )
As lena answered, it did help. Thank you for your help!
Starting it from the terminal does the job.
In my case I build a starter script
I am running the ultimate version of IntelliJ. The CE version does have another path to start!
The next two nice things to have would be
If anyone can help, go ahead!-)