1.环境准备
Centos7
安装nodejs
以下是百度网盘下载资源 提取码 6666
node-v12.18.3-linux-x64.tar.xz
- 解压
tar -xvf node-v12.18.3-linux-x64.tar.xz -C /usr/local/
- 配置环境变量
vim /etc/profile
export NODE_HOME=/usr/local/node-v12.18.3-linux-x64
export PATH=$PATH:$NODE_HOME/bin
source /etc/profile
- 查看版本信息 出现版本号表示安装成功
[root@bogon download]# npm -version
6.14.6
- 设置淘宝国内镜像
npm config set registry="https://registry.npm.taobao.org"
2. 安装Sinopia
- 安装
npm install sinopia -g --no-optional --no-shrinkwrap
[root@bogon download]# npm install sinopia --no-optional --no-shrinkwrap
npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN saveError ENOENT: no such file or directory, open '/opt/download/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/opt/download/package.json'
npm WARN download No description
npm WARN download No repository field.
npm WARN download No README data
npm WARN download No license field.
+ sinopia@1.4.0
added 170 packages from 345 contributors in 48.315s
2 packages are looking for funding
run `npm fund` for details
- 启动
sinopia
[root@bogon ~]# sinopia
Sinopia doesn't need superuser privileges. Don't run it under root.
warn --- config file - /root/.config/sinopia/config.yaml
warn --- http address - http://192.168.227.129:4873/
- 修改配置文件
vim ~/.config/sinopia/config.yaml
- 最后一行添加 listen: 192.168.227.129:4873 保证共享访问
# a list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'@*/*':
# scoped packages
access: $all
publish: $authenticated
'*':
# allow all users (including non-authenticated users) to read and
# publish all packages
#
# you can specify usernames/groupnames (depending on your auth plugin)
# and three keywords: "$all", "$anonymous", "$authenticated"
access: $all
# allow all known users to publish packages
# (anyone can register by default, remember?)
publish: $authenticated
# if package is not available locally, proxy requests to 'npmjs' registry
proxy: npmjs
# log settings
logs:
- {type: stdout, format: pretty, level: http}
#- {type: file, path: sinopia.log, level: info}
# 最后一行添加环境
listen: 192.168.227.129:4873
-
UI界面
image.png
网友评论