简体   繁体   中英

npm ERR! Error: EACCES: permission denied, access '/Users/patrikkozak/.npm-global/lib/node_modules/@vue/cli'

I'm trying to install vue with npm install -g @vue/cli and I keep getting these errors...

I understand its permission issues but I just get different errors when running with sudo.

$ npm install --global @vue/cli

npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

npm WARN checkPermissions Missing write access to /Users/patrikkozak/.npm-global/lib/node_modules/@vue/cli

npm WARN checkPermissions Missing write access to /Users/patrikkozak/.npm-global/lib/node_modules/@vue/cli/node_modules

npm WARN checkPermissions Missing write access to /Users/patrikkozak/.npm-global/lib/node_modules/@vue

npm ERR. path /Users/patrikkozak/.npm-global/lib/node_modules/@vue/cli

npm ERR! code EACCES

npm ERR! errno -13

npm ERR! syscall access

npm ERR: Error: EACCES, permission denied. access '/Users/patrikkozak/.npm-global/lib/node_modules/@vue/cli'

npm ERR: { [Error: EACCES, permission denied. access '/Users/patrikkozak/.npm-global/lib/node_modules/@vue/cli']

npm ERR: stack: npm ERR: 'Error, EACCES. permission denied, access \'/Users/patrikkozak/:npm-global/lib/node_modules/@vue/cli\'', npm ERR: errno, -13: npm ERR, code: 'EACCES'. npm ERR! syscall: 'access', npm ERR! path: '/Users/patrikkozak/.npm-global/lib/node_modules/@vue/cli' } npm ERR!

npm ERR. The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR!

npm ERR, If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running

npm ERR. the command again as root/Administrator (though this is not recommended).

npm ERR: A complete log of this run can be found in. npm ERR. /Users/patrikkozak/.npm/_logs/2020-01-21T22_50_17_086Z-debug.log

I've done research on why this is happening and I've tried reinstalling node, npm, etc.

I'm not sure if this is even relevant but when I run node -v: I get v10.15.1 But when running 'nvm ls' it returns my node version as v13.7.0

I'm also very new to asking questions on stackoverflow so I'm sorry for the poor formatting...

Give this command a shot

npm install -g decompress-tar then rerun npm install -g @vue/cli

If that doesn't work, try:

npm install -g @vue/cli --cache /tmp/empty-cache

it uses the a temp cache.

Taken from here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM