npm install ali-oss error

What I Wanted to Do

I wanted to install ali-oss package for node project.

Details

$ cd <my_project>
$ npm install ali-oss

I failed installation and got following messages.

Unhandled rejection Error: EACCES: permission denied, open ā€˜/Users/liaofang/.npm/_cacache/index-v5/a4/40/9079b06a182aaf68b57bf316ec6754a2abb040456409617a1367003d419dā€™

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/liaofang/.npm/_logs/2019-06-16T13_21_45_243Z-debug.log

2019-06-16T13_21_45_243Z-debug.log (14.9 KB)

Platform Info

$ npm --versions
<!-- paste output here -->
{ test2: '1.0.0',
  npm: '6.9.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '34.0',
  http_parser: '2.8.0',
  icu: '63.1',
  llhttp: '1.0.1',
  modules: '67',
  napi: '4',
  nghttp2: '1.34.0',
  node: '11.9.0',
  openssl: '1.1.1a',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.25.0',
  v8: '7.0.276.38-node.16',
  zlib: '1.2.11' }


$ node -p process.platform
<!-- paste output here -->
darwin

Hi @olga! There is an open issue with installing global packages using sudo leaving behind files with the wrong ownership.

The short version is run this to fix the ownership, then try your install again:

sudo chown -R $(whoami) ~/.npm
cd <my_project>
npm install ali-oss

Thank you for your kind assistance.

1 Like