gpt4 book ai didi

node.js - 安装 sinopia npm 后无法正常工作

转载 作者:搜寻专家 更新时间:2023-10-31 23:30:32 25 4
gpt4 key购买 nike

在安装 sinopia 之前一切正常,但安装 npm 之后就失败了。请帮我回滚到原始设置。
每当它尝试安装新的 npm 包时都会出错。例如。当我运行这个

npm install -g mocha grunt-cli bower karma-cli

npm ERR! Linux 4.4.0-34-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "mocha" "grunt-cli" "bower" "karma-cli"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect

npm ERR! Error: connect ECONNREFUSED 127.0.0.1:4873
npm ERR! at Object.exports._errnoException (util.js:870:11)
npm ERR! at exports._exceptionWithHostPort (util.js:893:20)
npm ERR! at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1061:14)
npm ERR! { [Error: connect ECONNREFUSED 127.0.0.1:4873]
npm ERR! code: 'ECONNREFUSED',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! syscall: 'connect',
npm ERR! address: '127.0.0.1',
npm ERR! port: 4873 }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly. See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR! /home/owaishanif/huble/meetings/npm-debug.log

这是我的sinopia配置文件

#
# 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/owaishanif/.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: 1000

# 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}

最佳答案

要引用标准的 npm 注册表而不是你自己的,你可以运行

npm set registry https://registry.npmjs.org/

这将更新您的 .npmrc 配置文件。

关于node.js - 安装 sinopia npm 后无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39003119/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com