Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

将node开发环境从linux迁移到win10 bash on linux #18

Open
varHarrie opened this issue Jul 20, 2017 · 4 comments
Open

将node开发环境从linux迁移到win10 bash on linux #18

varHarrie opened this issue Jul 20, 2017 · 4 comments

Comments

@varHarrie
Copy link
Owner

varHarrie commented Jul 20, 2017

开启Windows 10的Linux子系统

  • 第一步:

image

  • 第二步:

image

  • 第三步:

重启电脑,等待更新。

  • 第四步:

CMD中输入:

bash
#
lxrun /install /y

等待安装完毕,以后在CMD中输入bash,即可进入linux子系统

安装node环境(通过nvm

  • 在CMD中通过bash进入linux

  • 安装nvm:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
  • 安装node和npm:
nvm install stable
# 等待安装完毕后,激活该版本:
nvm use stable
  • 解决sudo npm 未找到命令:
sudo ln -s $(which node) /usr/bin/node
sudo ln -s $(which npm) /usr/bin/npm

至此完成linux和node的安装。

@yanbo0039
Copy link

这么牛。。。。

@zhanghuid
Copy link

zhanghuid commented Mar 1, 2018

貌似我在安装的时候,提示了zsh: command not found: nvm
解决方案:
bird.so后,发现还需要执行如下命令. ~/.nvm/nvm.sh

2018-04-04补充,原来是我的bash问题,我使用了.zshrc。

解决方案:

确认以下路径已添加到~/.zshrc:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"

@hua03
Copy link

hua03 commented May 12, 2018

用了半年的 WSL,最近要使用 vue 开发单页应用,老是在打包的时候卡住不动。换了 git bash ,40s就打包完了。。。日常开发的时候挺爽的,编译的时候可能差点

@suyanhanx
Copy link

厉害了。。用上了,谢谢楼主

@varHarrie varHarrie added this to the Posts milestone Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants