无法在MacOS上启动NPM服务,Intellij ultimate on Vuejs项目

发布于 2025-01-31 03:15:37 字数 1011 浏览 0 评论 0原文

我未能启动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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

半衾梦 2025-02-07 03:15:37

问题是节点不在您的$ 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)

oО清风挽发oО 2025-02-07 03:15:37

AS lena 回答,确实有帮助。感谢您的帮助!
从终端开始工作。

就我而言,我构建了一个入门脚本,

#! /bin/bash
/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea &

我正在运行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

#! /bin/bash
/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea &

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

  • to have the opened terminal window automatically closed
  • link it with a proper icon placed on the desktop.

If anyone can help, go ahead!-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文