linux centos7下安装nodejs、npm、vue

安装nodejs

curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
yum install -y nodejs
node -v

安装npm

npm install -g cnpm --registry=https://registry.npm.taobao.org
npm install
npm -v

安装vue

npm install -g @vue/cli -registry=https://registry.npm.taobao.org
vue-V

修改npm的仓库源

#设置淘宝仓库源
npm config set registry=https://registry.npm.taobao.org
#查看当前仓库源
npm get registry

运行项目

在当前项目目录下

npm install -registry=https://registry.npm.taobao.org
#前台运行
npm run serve
#centos后台运行
nohup npm run serve>/dev/null 2>&1 & exit
posted @ 2021-01-15 14:11  dkn  阅读(694)  评论(0编辑  收藏  举报