如何酿造安装特定版本的节点?
例如,我想要安装7.9或7.10,但由于webpack node-sass
破坏错误,所以要避免使用节点8。
当我运行brew search node
这是我所看到的:
❯brewsearch节点leafnode llnode节点✔node-build> node@0.10 node@0.12节点@ 4节点@ 6 nodebrew nodeenv nodenv caskroom / cask / node-profiler
如果你的意思是“节点”:从木桶/木桶迁移到自制/核心。 您可以通过运行brew tap homebrew / core来再次访问它
有检查的节点(我当前的版本是v7.4.0
然后node@4
node@0.12
, node@4
node@0.12
, node@4
和node@6
?
我不能完全升级到8的原因是node-sass在webpack中不起作用。
刚刚安装NVM,得到这个疯狂的错误日志:
=> 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_profile)
❯ nvm --version 0.33.2
如果自定义homebrew/code
版本定义正确,则还必须能够创buildbrew install node@0.12
。
您也可以安装多个版本,并select您要使用brew switch
命令使用的版本。
–
无论如何,我build议使用nvm ,可以通过Homebrew安装。 虽然, brew
的版本是越野车,他们不打算修复它。