Friday, 2 June 2017

npm - EPERM: operation not permitted on Linux

I'm trying to do the react tutorial on my local machine (centOS)

I ran

sudo npm install -g create-react-app

After running that command I got the following error

npm ERR! Linux 3.10.0-514.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "create-react-app"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! path /tmp/npm-1422-84cdbe70/registry.npmjs.org/tar/-/tar-2.2.1.tgz
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall open
npm ERR! Error: EPERM: operation not permitted, open '/tmp/npm-   1422-84cdbe70/registry.npmjs.org/tar/-/tar-2.2.1.tgz' while getting shasum for /tmp/npm-1422-84cdbe70/registry.npmjs.org/tar/-/tar-2.2.1.tgz
npm ERR! From:     https://registry.npmjs.org/tar/-/tar-2.2.1.tgz
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, open '/tmp/npm-1422-84cdbe70/registry.npmjs.org/tar/-/tar-2.2.1.tgz' while getting shasum for /tmp/npm-1422-84cdbe70/registry.npmjs.org/tar/-/tar-2.2.1.tgz
npm ERR! From:     https://registry.npmjs.org/tar/-/tar-2.2.1.tgz
npm ERR!     at Error (native)
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'open',
npm ERR!   path: '/tmp/npm-1422-84cdbe70/registry.npmjs.org/tar/-/tar-2.2.1.tgz',
npm ERR!   parent: 'tar-pack' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

I tried going into the directory and untarring the .tgz file and changing around some of the permissions and nothing worked. I followed some solutions online with similar problems but still no luck.

I also ran

npm cache clear

Can anyone explain why this is happening? Any suggestions?



via Alcamech

No comments:

Post a Comment