Deploying basic node.js app to openshift gives err

2019-05-12 03:33发布

问题:

  • I set up a default node application using the procedure on the openshift website,
  • did a git clone on my ubuntu box,
  • edited the readme.md,
  • did a commit
  • and tried pushing to the repo
  • got a lot of npm fetch failed errors, and a lot of - Error: SELF_SIGNED_CERT_IN_CHAIN errors

    ... remote: npm ERR! fetch failed https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz remote: npm info retry will retry, error on last attempt: Error: SELF_SIGNED_CERT_IN_CHAIN

    remote: npm http GET https://registry.npmjs.org/negotiator/-/negotiator-0.3.0.tgz
    remote: npm ERR! Error: SELF_SIGNED_CERT_IN_CHAIN
    remote: npm ERR!     at SecurePair.<anonymous> (tls.js:1283:32)
    remote: npm ERR!     at SecurePair.EventEmitter.emit (events.js:92:17)
    remote: npm ERR!     at SecurePair.maybeInitFinished (tls.js:896:10)
    remote: npm ERR!     at CleartextStream.read [as _read] (tls.js:430:15)
    remote: npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:304:10)
    remote: npm ERR!     at EncryptedStream.write [as _write] (tls.js:344:25)
    remote: npm ERR!     at doWrite (_stream_writable.js:211:10)
    remote: npm ERR!     at writeOrBuffer (_stream_writable.js:201:5)
    remote: npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:172:11)
    remote: npm ERR!     at write (_stream_readable.js:557:24)
    remote: npm ERR!     at flow (_stream_readable.js:566:7)
    remote: npm ERR!     at Socket.pipeOnReadable (_stream_readable.js:598:5)
    
    remote: npm info preuninstall commander@1.3.2
    remote: npm info uninstall commander@1.3.2
    remote: npm info postuninstall commander@1.3.2
    remote: npm ERR!
    remote: npm ERR! Additional logging details can be found in:
    remote: npm ERR!     /var/lib/openshift/53100d354382ec58b5000032/app-root/runtime/repo/npm-debug.log
    remote: npm ERR! not ok code 0
    remote: An error occurred executing 'gear postreceive' (exit code: 1)
    remote: Error message: CLIENT_ERROR: Failed to execute: 'control build' for /var/lib/openshift/53100d354382ec58b5000032/nodejs
    remote:
    remote: For more details about the problem, try running the command again with the '--trace' option
    To ssh://53100d354382ec58b5000032@pmcloud-stellagreen.rhcloud.com/~/git/pmcloud.git/
       c851403..54dc73a  master -> master
    

Looking at the logs is not helping. Help appreciated.

回答1:

npm acknowledged this error on their blog: http://blog.npmjs.org/post/78085451721/npms-self-signed-certificate-is-no-more

The solution: either

1) upgrade your version of npm

npm install npm -g - or -

2) tell your current version of npm to use known registrars

npm config set ca ""



回答2:

ssh to your app then set http for npm

npm config set registry="http://registry.npmjs.org/"

push your code again



回答3:

Send here your package.js.

Look at dependencies block:

negotiator:"0.4.1"