代码之家  ›  专栏  ›  技术社区  ›  Fury

403安装NPM时禁止使用-Ubuntu 14.0

  •  1
  • Fury  · 技术社区  · 7 年前

    我正在尝试在我的Ubuntu14.0服务器上安装NPM和Nodejs。

    我已经安装了nodejs sudo apt-get install nodejs 但当我安装 npm 我得到403个禁止错误。

        $ sudo apt-get install npm
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
    gyp libc-ares-dev libjs-node-uuid libssl-dev libssl-doc libssl1.0.2
    libv8-3.14-dev node-abbrev node-ansi node-archy node-async node-block-stream
    node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent
    node-form-data node-fstream node-fstream-ignore node-github-url-from-git
    node-glob node-graceful-fs node-gyp node-inherits node-ini
    node-json-stringify-safe node-lockfile node-lru-cache node-mime
    node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt
    node-normalize-package-data node-npmlog node-once node-osenv node-qs
    node-read node-read-package-json node-request node-retry node-rimraf
    node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent
    node-which nodejs-dev zlib1g zlib1g-dev
    Suggested packages:
    node-hawk node-aws-sign node-oauth-sign node-http-signature
    The following NEW packages will be installed:
    gyp libc-ares-dev libjs-node-uuid libssl-dev libssl-doc libv8-3.14-dev
    node-abbrev node-ansi node-archy node-async node-block-stream
    node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent
    node-form-data node-fstream node-fstream-ignore node-github-url-from-git
    node-glob node-graceful-fs node-gyp node-inherits node-ini
    node-json-stringify-safe node-lockfile node-lru-cache node-mime
    node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt
    node-normalize-package-data node-npmlog node-once node-osenv node-qs
    node-read node-read-package-json node-request node-retry node-rimraf
    node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent
    node-which nodejs-dev npm zlib1g-dev
    The following packages will be upgraded:
    libssl1.0.2 zlib1g
    2 upgraded, 53 newly installed, 0 to remove and 257 not upgraded.
    Need to get 4,062 kB/5,590 kB of archives.
    After this operation, 16.0 MB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    

    然后我说 Y

    WARNING: The following packages cannot be authenticated!
    libssl1.0.2 libssl-dev libssl-doc
    Install these packages without verification? [y/N] y
    

    然后我说 Y 在这里我得到了被禁止的错误。

    Err http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/ trusty/main libssl1.0.2 amd64 1.0.2h-1+deb.sury.org~trusty+1
    403  Forbidden
    Err http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/ trusty/main libssl-dev amd64 1.0.2h-1+deb.sury.org~trusty+1
    403  Forbidden
    Err http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/ trusty/main libssl-doc all 1.0.2h-1+deb.sury.org~trusty+1
    403  Forbidden
    E: Failed to fetch http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/pool/main/o/openssl/libssl1.0.2_1.0.2h-1+deb.sury.org~trusty+1                                                                                                            _amd64.deb  403  Forbidden
    
    E: Failed to fetch http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/pool/main/o/openssl/libssl-dev_1.0.2h-1+deb.sury.org~trusty+1_                                                                                                            amd64.deb  403  Forbidden
    
    E: Failed to fetch http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/pool/main/o/openssl/libssl-doc_1.0.2h-1+deb.sury.org~trusty+1_                                                                                                            all.deb  403  Forbidden
    
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
    

    我想我在安装这些软件包时遇到了问题:

    libssl1.0.2 libssl-dev libssl-doc
    
    2 回复  |  直到 7 年前
        1
  •  0
  •   Mustafa Karcıoğlu    7 年前
    sudo apt-key update
    sudo apt-get update
    

    它应该起作用。

        2
  •  0
  •   Fury    7 年前

    因为这些包裹 libssl1.0.2 libssl-dev libssl-doc 来自HTTP,源不安全。这就是Ubuntu忽略下载和安装的原因。

    使用此命令安装NPM npm install npm@latest -g 为我工作。

    此命令将在上安装最新版本 npm