Gulp installation issue

I’m try to install gulp and I’ve faced with a problem - error is:

Mac$ npm install gulp-cli -g
Error: EROFS: read-only file system, mkdir ‘/user’
TypeError: Cannot read property ‘loaded’ of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)
at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:78:20
at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)
at /usr/local/lib/node_modules/npm/lib/npm.js:263:24
at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7
at Array.forEach ()
at /usr/local/lib/node_modules/npm/lib/config/core.js:80:13
at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:171:20)
/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97
var doExit = npm.config.loaded ? npm.config.get(’_exit’) : true
^

TypeError: Cannot read property ‘loaded’ of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at process.emit (events.js:210:5)
at process._fatalException (internal/process/execution.js:150:25)

How to fix it?
Thank you in advance!

Not sure what npm is trying to do.

  1. Are you running macOS Catalina?

  2. What is:

npm prefix -g

Hi John!

Thank you for response!

  1. Yes
  2. Command “npm prefix -g” shows again:

Error: EROFS: read-only file system, mkdir ‘/user’
TypeError: Cannot read property ‘loaded’ of undefined

at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)
at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:78:20
at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)
at /usr/local/lib/node_modules/npm/lib/npm.js:263:24
at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/npm/lib/config/core.js:80:13
at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:171:20)

/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97
var doExit = npm.config.loaded ? npm.config.get(’_exit’) : true
^

TypeError: Cannot read property ‘loaded’ of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at process.emit (events.js:210:5)
at process._fatalException (internal/process/execution.js:150:25)

May be there are some problems with routes?

  1. Should I do anything with configs?
  2. Will it help if I will uninstall node/npm and install again after? If Yes - How can I do that?

Yes, looks like a problem in your config file. Reinstalling node/npm will probably not help.

You could move .npmrc out of the way, to at least confirm it is the problem. e.g.

mv ~/.npmrc ~/.npmrc.old
npm prefix -g

Have a look in an editor to see if there is an obvious incorrect line, and if you can’t spot it, you could post it here, but mask any secrets that should not be shared.

Thank you!

I’ve removed all npm and npmrc files from the root directory - that helped to me!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.