capacitor-assets: Can't install on my mac
Can’t install with this log:
/usr/local/bin/cordova-res -> /usr/local/lib/node_modules/cordova-res/bin/cordova-res
> sharp@0.22.1 install /usr/local/lib/node_modules/cordova-res/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-darwin-x64.tar.gz
ERR! sharp EACCES: permission denied, open '/usr/local/lib/node_modules/cordova-res/node_modules/sharp/16245-libvips-8.7.4-darwin-x64.tar.gz'
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies
gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/mauro/.node-gyp/10.16.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/cordova-res/node_modules/sharp/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/cordova-res/node_modules/sharp/.node-gyp'
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/cordova-res/node_modules/sharp
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.22.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.22.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mauro/.npm/_logs/2019-06-25T14_34_41_300Z-debug.log
Some help ?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 24 (2 by maintainers)
I solve with command: npm i -g cordova-res --unsafe-perm
I added ‘sudo’ in front of the suggested ‘npm i -g cordova-res --unsafe-perm’ so:
sudo npm i -g cordova-res --unsafe-perm
which worked for me!thanks.
You have a lot of permissions issues, likely from using a mix of
sudo
and non-sudo
npm commands.See these docs: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
You can also use a tool like nvm: https://github.com/nvm-sh/nvm
I am having the same issue, but unfortunately using --unsafe-perm isn’t changing the outcome and I still have the error that ‘vips/vips8’ file not found in common.cc:25:10.