Search code examples
npm-installapostropheapostrophe-cms

In a project created using apostrophe create-project in Ubuntu 18.04, npm install fails


npm ERR! registry error parsing json
npm ERR! registry error parsing json
npm ERR! registry error parsing json
npm ERR! fetch failed https://registry.npmjs.org/less/-/less-3.8.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 400
npm ERR! fetch failed https://registry.npmjs.org/nodemailer/-/nodemailer-4.6.8.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 400
npm ERR! fetch failed https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 400
npm ERR! Linux 4.15.0-32-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2

npm ERR! Unexpected token < in JSON at position 0
npm ERR! <html>
npm ERR! <head><title>400 The SSL certificate error</title></head>
npm ERR! <body bgcolor="white">
npm ERR! <center><h1>400 Bad Request</h1></center>
npm ERR! <center>The SSL certificate error</center>
npm ERR! <hr><center>cloudflare-nginx</center>
npm ERR! </body>
npm ERR! </html>
npm ERR! 
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/radhika/code/practice/test-project/npm-debug.log

I am following the apostrophe documentation I have installed apostrophe-cli, node, npm, mongo, nginx How do I resolve this? If npm has a problem installing one particular package, how do I fix it?


Solution

  • Running sudo apt-get update && sudo apt-get -y upgrade sudo apt-get install software-properties-common imagemagick build-essential git openssl fixed the issue for me