{"id":98,"hash":"023b0e42ab466362a7c4d5207962e0e41e3d518c0ba2f084ef9a7bb1b4c45225","pattern":"Error: EACCES: permission denied, access &#39;/usr/local/lib/node_modules&#39;","full_message":"What might be causing the error Error: EACCES: permission denied, access '/usr/local/lib/node_modules'?\n\nnpm ERR! path /usr/local/lib/node_modules\nnpm ERR! code EACCES\nnpm ERR! errno -13\nnpm ERR! syscall access\nnpm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'\nnpm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'\nnpm ERR!   errno: -13,\nnpm ERR!   code: 'EACCES',\nnpm ERR!   syscall: 'access',\nnpm ERR!   path: '/usr/local/lib/node_modules' }\nnpm ERR! \nnpm ERR! Please try running this command again as root/Administrator.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /Users/macbookmd101/.npm/_logs/2018-02-21T16_26_08_421Z-debug.log","ecosystem":"npm","package_name":"node.js","package_version":null,"solution":"Change your file permissions... Like this\n\nFirst check who owns the directory\n\nls -la /usr/local/lib/node_modules\n\nit is denying access because the node_module folder is owned by root\n\ndrwxr-xr-x   3 root    wheel  102 Jun 24 23:24 node_modules\n\nso this needs to be changed by changing root to your user but first run command below to check your current user How do I get the name of the active user via the command line in OS X?\n\nid -un OR whoami\n\nThen change owner\n\nsudo chown -R [owner]:[owner] /usr/local/lib/node_modules\n\nOR\n\nsudo chown -R ownerName: /usr/local/lib/node_modules\n\nOR\n\nsudo chown -R $USER /usr/local/lib/node_modules","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/48910876/error-eacces-permission-denied-access-usr-local-lib-node-modules","votes":765,"created_at":"2026-04-19T04:41:18.788649+00:00","updated_at":"2026-04-19T04:51:01.808880+00:00"}