例如,我想安装7.9或7.10,但想避免 node 8,因为webpack node-sass destruct 错误.

当我跑brew search node时,我看到的是:

❯ brew search node leafnode llnode node ✔ node-build > node@0.10 node@0.12 node@4 node@6 nodebrew nodeenv nodenv caskroom/cask/node-profiler

如果你具体指的是" node ":

有一个 node 被选中(我当前的版本是v7.4.0,然后是node@0.10node@0.12node@4node@6

我不能完全升级到8的原因是 node sass在webpack中无法工作.


刚刚安装了NVM,得到了这个疯狂的错误日志(log):

=> nvm source string already in /Users/leongaban/.zshrc => Appending bash_completion source string to /Users/leongaban/.zshrc npm ERR! missing: is-path-cwd@^1.0.0, required by del@3.0.0 npm ERR! missing: is-path-in-cwd@^1.0.0, required by del@3.0.0 npm ERR! missing: p-map@^1.1.1, required by del@3.0.0 npm ERR! missing: pify@^3.0.0, required by del@3.0.0 npm ERR! missing: rimraf@^2.2.8, required by del@3.0.0 npm ERR! missing: bluebird@^3.1.1, required by gulp-html-replace@1.6.2 npm ERR! missing: clone@^1.0.2, required by gulp-html-replace@1.6.2

...

=> You currently have modules installed globally with `npm`. These will no
=> longer be linked to the active version of Node when you install a new node
=> with `nvm`; and they may (depending on how you construct your `$PATH`)
=> override the binaries of modules installed with `nvm`:

如果我读对了,这是否意味着我不能再使用npm来全局安装软件包,而必须使用nvm

使现代化

我将导出行添加到我的.zshrc bash(我不使用bash_配置文件)

❯ nvm --version
0.33.2

推荐答案

如果homebrew/code上的版本定义正确,您还必须能够定义brew install node@0.12,例如.

您还可以安装多个版本,并通过brew switch命令 Select 要使用的版本.

--

无论如何,我建议使用nvm,它可以通过brew 软件安装.不过,brew上的版本有问题,他们不打算修复它.

Node.js相关问答推荐

错误:找不到模块';/var/apps/前端/bash';

使用ReadableStream.管道时NodeJS Crypto Hash不正确

为什么 mongoose 没有常规数组方法

编写动态创建的 YAML - 为生态系统创建 Docker compose 文件(使用 js-yaml)

更新 mongodb 中的交易值

使用 Nodejs 获取 Firebase 云消息传递历史记录

如何在mongodb中获取对象数组内部的数据

使用react 组件加载特定 DIV 而无需重新加载整个页面

如何使用 Jest 模拟异步函数的延迟时间

在mongodb中只查询整数

FirebaseCloudMessaging : PlatformException (PlatformException(null-error, Host platform returned null value for non-null return value., null, null))

node.js 中 pdfkit-tables 中的垂直线

解决并行保存到 mongodb

如果我使用像 express 这样的 node 服务器,是否需要 webpack-dev-server

Sequelize 基于关联的查找

如何在 Node.js 中等待子进程完成

如何在不全局安装的情况下在 Node REPL 中要求 node 模块?

如何在 NodeJs 中下载和解压缩内存中的 zip 文件?

使用 gzip/deflate 压缩的简单 HTTP 请求

在 Node.js 上使用 Connect 无法获取 /