Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Error: EPERM, chown '/[WORKING DIR]/node_modules/[PACKAGE NAME]/package.json' #11717

Closed
giacecco opened this issue Feb 29, 2016 · 1 comment
Closed

Comments

@giacecco
Copy link

This is an old issue that likely was never solved, e.g. in #7563 or #6905, usually addressed by the very kind @smikes .

I need to use node 0.12.x and its latest associated npm to be as close as possible to a deployment environment I can't control (Gandi.net's basic hosting). To be able to use an old node, I test my code in a clean Docker container with the latest Debian and node 0.12.x from nodesource.

The installation of npm packages however always fails with something that looks like the console output below. Remember that all of this runs as root.

root@3adc90053544:/opt# npm install
npm WARN package.json dicoim-main-website@0.0.1 No README data
npm ERR! tar.unpack untar error /root/.npm/express/4.13.4/package.tgz
npm ERR! Linux 4.1.18-boot2docker
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v0.12.10
npm ERR! npm  v2.14.9
npm ERR! path /opt/node_modules/express/package.json
npm ERR! code EPERM
npm ERR! errno -1

npm ERR! Error: EPERM, chown '/opt/node_modules/express/package.json'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM, chown '/opt/node_modules/express/package.json']
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/opt/node_modules/express/package.json',
npm ERR!   fstream_finish_call: 'chown',
npm ERR!   fstream_type: 'File',
npm ERR!   fstream_path: '/opt/node_modules/express/package.json',
npm ERR!   fstream_class: 'FileWriter',
npm ERR!   fstream_stack: 
npm ERR!    [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/writer.js:306:21',
npm ERR!      '/usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:210:7',
npm ERR!      'FSReqWrap.oncomplete (fs.js:95:15)' ] }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /opt/npm-debug.log
root@3adc90053544:/opt

Because this is a Debian image prepared for Docker, I'm already running this as root and there's not even a sudo command available. npm cache clean achieves nothing. The cache is in /root/.npm. The full npm-debug.log is at https://gist.github.com/giacecco/8504d2e8501b59f610d9 .

I used node in Docker systems before without ever finding this issue, this is why I presume it is related to 0.x versions of node and was solved eventually in later versions. But is there a workaround for older versions?

Thanks.

@npm-robot
Copy link

We're closing this issue as it has gone seven days without activity and without being labeled. If we haven't even labeled in issue in seven days then we're unlikely to ever read it.

If you are still experiencing the issue that led to you opening this or this is a feature request you're still interested in then we encourage you to open a new issue. If this was a support issue, you may be better served by joining package.communty and asking your question there.

For more information about our new issue aging policies and why we've instituted them please see our blog post.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants