Ghost local install gives consistent 401 'not authorized' error on MacOS

I’m trying to install Ghost locally to evaluate for a project. I followed the instructions but when I run

ghost local install

or

sudo ghost local install

I get the following error

I changed the folder permissions of the folder in which I’m trying to install to allow universal read/write, but it makes no difference.

Dead in the water at the moment, any help appreciated!

There’s some more info here on installing Ghost, also shows the recommended version of Node to use:

@DavidDarnes – I changed the version of node I was using from 12.x (which should be supported, apparently) to 10.19, as 10.x was recommended. I still get the same error

Debug Information:
    OS: Mac OS X, v10.14.5
    Node Version: v10.19.0
    Ghost-CLI Version: 1.13.1
    Environment: development
    Command: 'ghost install local'
An error occurred.
Message: 'Response code 401 (Unauthorized)'

Stack: HTTPError: Response code 401 (Unauthorized)
    at EventEmitter.ee.on.res (/usr/local/share/.config/yarn/global/node_modules/download/node_modules/got/index.js:482:24)
    at EventEmitter.emit (events.js:198:13)
    at getResponse (/usr/local/share/.config/yarn/global/node_modules/download/node_modules/got/index.js:320:5)
    at Immediate.setImmediate (/usr/local/share/.config/yarn/global/node_modules/download/node_modules/got/index.js:147:6)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
Path: /axags/api/npm/virtual-bcn-node/ghost/-/ghost-3.5.0.tgz 

The line referenced is

	if (opts.throwHttpErrors && statusCode !== 304 && (statusCode < 200 || statusCode > 299)) {
			proxy.emit('error', new got.HTTPError(statusCode, res.statusMessage, res.headers, opts), null, res);
			return;
		}

So it seems to be some issue with got ?

It was an issue with the connection at our end, settings in .npmrc were interfering with the process

1 Like