# 安装 nvm wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash # 重启shell # 验证 nvm 安装 command -v nvm
# 安装 Node nvm install --lts #验证安装 --> v8.9.1 node -v
# 安装 npm install -g sinopia # 验证是否安装成功 --> 这一步会输出自动生成的配置文件路径等信息。 sinopia
# 安装 lsof 命令 sudo apt-get update sudo apt-get install lsof # 查看端口占用进程 PID lsof -i :4873 # 杀死占用 4873 端口的进程。4649,要换为实际的 PID。 kill -9 4649
npm set registry http://localhost:4873/ npm adduser --registry http://localhost:4873/
shell set mouse=v
#
# This is the default config file. It allows all users to do anything,
# so don't use it on production systems.
#
# Look here for more config file examples:
# https://github.com/rlidwka/sinopia/tree/master/conf
#
# path to a directory with all packages
storage: /home/pi/.local/share/sinopia/storage
auth:
htpasswd:
file: ./htpasswd
# Maximum amount of users allowed to register, defaults to "+inf".
# You can set this to -1 to disable registration.
max_users: -1
# a list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npm.taobao.org
packages:
'@*/*':
# scoped packages
access: $authenticated
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: $authenticated
# 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}
max_body_size: '200mb'
# 打开配置文件 vim /home/pi/.config/sinopia/config.yaml
:set paste i # 右键粘贴即可。
[web-sinopia] type = http local_port = 4873 subdomain = sinopia
sudo vim /usr/lib/systemd/system/sinopia.service
[Unit] DescrIPtion=sinopia After=network.target [Service] TimeoutStartSec=30 ExecStart=/home/pi/.nvm/versions/node/v8.9.1/bin/sinopia /home/pi/.config/sinopia/config.yaml ExecStop=/bin/kill $MAINPID Restart=on-failure RestartSec=42s [Install] WantedBy=multi-user.target
systemctl enable sinopia systemctl start sinopia systemctl status sinopia
# 禁用服务 systemctl disable sinopia # 重新启动服务 systemctl restart sinopia
npm set registry http://sinopia.example.com npm adduser --registry http://sinopia.example.com npm login
# 在某个文件夹初始化一个新的 npm 包 npm init # 发布到私有 sinopia 服务器: npm publish
unregistered users are not allowed to access package
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有