Leo*_*ban 11 javascript homebrew node.js
例如,我想安装7.9或7.10但是由于webpack node-sass破坏错误而希望避免使用Node 8 .
当我运行时,brew search node这就是我所看到的:
❯brew搜索节点leafnode llnode节点✔node-build> node@0.10 node@0.12 node @ 4 node @ 6 nodebrew nodeenv nodenv caskroom/cask/node-profiler
如果你具体指的是"节点":它是从caskroom/cask迁移到homebrew/core.您可以通过运行:brew tap homebrew/core再次访问它
存在被检查的节点(我目前的版本是v7.4.0,然后node@0.10,node@0.12,node@4和node@6?
我不能完全升级到8的原因是node-sass在webpack中不起作用.
=> 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`:
Run Code Online (Sandbox Code Playgroud)
如果我正确读到这个,这是否意味着我不能再使用npm全局安装包而必须使用nvm?
我将导出行添加到我的.zshrc bash(我不使用bash_profile)
? nvm --version
0.33.2
Run Code Online (Sandbox Code Playgroud)
shi*_*ovk 15
例如安装节点 14:
brew install node@14
brew unlink node
brew link node@14
node -v
Run Code Online (Sandbox Code Playgroud)
如果homebrew/code正确定义了版本,则您也必须能够brew install node@0.12例如。
您还可以安装多个版本,然后选择要与brew switch命令一起使用的版本。
-
无论如何,我建议使用可以通过Homebrew安装的nvm。虽然,该版本上brew存在错误,并且他们不打算对其进行修复。
安装最新版本的节点并取消链接之前安装的
brew install node@14
brew unlink node
brew link --overwrite node@14
echo 'export PATH="/usr/local/opt/node@14/bin:$PATH"' >> ~/.bash_profile
node -v
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
22855 次 |
| 最近记录: |