gpt4 book ai didi

macos - 如何为在自定义路径上安装 Homebrew 软件的 node.js 安装 npm?

转载 作者:搜寻专家 更新时间:2023-10-31 23:14:30 25 4
gpt4 key购买 nike

<分区>

我使用的是 Mac OS X Lion 10.7,并安装了 homebrew 并在自定义路径中进行了备用安装,以保持它的用户范围不需要 sudo。我成功安装了 node.js。但是 npm 没有被安装。

Last login: Tue Nov 29 10:26:51 on ttys003
Hoons-MacBook-Air:~ Eonil$ node --version
v0.6.2
Hoons-MacBook-Air:~ Eonil$ node
>
(^C again to quit)
> Hoons-MacBook-Air:~ Eonil$ curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7184 100 7184 0 0 4581 0 0:00:01 0:00:01 --:--:-- 19363
npm cannot be installed without nodejs.
Install node first, and then try again.

Maybe node is installed, but not in the PATH?
Note that running as sudo can change envs.

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:~/Unix/homebrew/bin
Hoons-MacBook-Air:~ Eonil$ ls ~/Unix/homebrew/bin/
brew node node-waf
Hoons-MacBook-Air:~ Eonil$

我看到 node 的二进制文件路径已添加到 $PATH 变量中。我不知道为什么 npm 会提示。我怎样才能安装它?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com