2017-06-28 12 views
0

プライベートレジストリ(Nexus)に接続するようにnpmを設定しようとしています。 残念ながら、ネクサスのインストールはWebsealによって保護されています。 私は、NPMの設定でレジストリを設定している、と私はNPMログインを行うとき、私は私がWebSEALのユーザー名とパスワードを使用していた以下のWebsealで保護されたプライベートレジストリにアクセスするようにnpmを設定します

npm ERR! registry error parsing json 
npm WARN adduser Incorrect username or password 
npm WARN adduser You can reset your account by visiting: 
npm WARN adduser 
npm WARN adduser  https://npmjs.org/forgot 
npm WARN adduser 
npm ERR! Unexpected token < in JSON at position 0 
npm ERR! <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 
npm ERR! <!-- Copyright (C) 2000 Tivoli Systems, Inc. --> 
npm ERR! <!-- Copyright (C) 1999 IBM Corporation --> 
npm ERR! <!-- Copyright (C) 1998 Dascom, Inc. --> 
npm ERR! <!-- All Rights Reserved. --> 
npm ERR! <!-- 
npm ERR!  This is a WebSEAL error message template file. It is used 
npm ERR!  by the WebSEAL server to build a response when a particular 
npm ERR!  error occurs. This file can be modified as appropriate. 
npm ERR! 
npm ERR!  Error details: 
npm ERR! 
npm ERR!  * Code: 0x38cf0425 
npm ERR!  * Text: Unauthorized 
npm ERR! 
npm ERR! --> 
npm ERR! <html> 
npm ERR! <head> 
npm ERR! <meta http-equiv="Content-Type" content= "text/html; charset=UTF-8"> 
npm ERR! <!-- Enter Page Title --> 
npm ERR! <title>Login Required</title> 
npm ERR! </head> 
npm ERR! <body bgcolor="#FFFFFF"> 
npm ERR! 
npm ERR! <!-- Enter Message Header --> 
npm ERR! <h1><font color="#FF0000">Login Required</font></h1> 
npm ERR! 
npm ERR! <p><!-- Enter Error Message --> 
npm ERR! You must login before you can access the resource you have requested. 
npm ERR! 
npm ERR! <BR><BR><BR> 
npm ERR! 
npm ERR! <!-- Provide Error Explanation --> 
npm ERR! <H4>Explanation</H4> 
npm ERR! <P>The resource you have requested is secured by Access Manager WebSEAL, and in 
npm ERR! order to access it, you must first login. 
npm ERR! </P> 
npm ERR! 
npm ERR! <BR><BR><BR> 
npm ERR! 
npm ERR! <!-- Provide Possible Solution --> 
npm ERR! <H4>Solutions</H4> 
npm ERR! <P>Log in with a valid account. 
npm ERR! </P> 
npm ERR! 
npm ERR! <br> 
npm ERR! <br> 
npm ERR! <br> 
npm ERR! <!-- Enter Link --> 
npm ERR! <a href="/">[BACK BUTTON]</a></p> 
npm ERR! </body> 
npm ERR! </html> 
npm ERR! 
npm ERR! 

を取得します。

答えて

0

ここに少なくとも部分的な答えがあります。 必要なのは、プロキシ設定のwebpack devサーバーです。ここ は...

// If you have to go though a corperate proxy the following is needed. 
var HttpsProxyAgent = require('https-proxy-agent'); 
// corporate proxy to connect to 
var proxyServer = 'http://<proxyserver>:<proxyport/'; 
var proxyAgent = new HttpsProxyAgent(proxyServer); 

// Webseal auth, must be in the form of <devUser>:<devPassword> 
// I know that having an unencrypted password is HORRIBLE!!! 
// Working on something better 
var auth = '<websealuser>:<websealpassword'; 

proxy: { 
    '/nexus/**': { 
    target: 'https://<target>/', 
    secure: false, 
    'changeOrigin': true, 
    'auth': auth, 
    // Comment out the following line if not going through a corperate proxy 
    agent: proxyAgent, 
    logLevel: 'debug', 
    toProxy: true 

} webpack.config.jsの抜粋です

その後、localhostにNPMのレジストリ値を設定する必要があります:8080(またはWebPACKのdevのサーバーから提供されますどのような値。

私は、コマンドをインストールします。falseに厳格な-SSLを設定するために

スタートWebPACKのdevのサーバーを提案し、NPMをしようとするだろう。それは、プロキシのプライベートリポジトリへの要求をする必要があります。

現在、実際にダウンロードするにはタイムアウトの問題が発生していますが、メタデータが表示されています。

関連する問題