ubuntuでnodenvを用い、node.jsの開発環境を構築しているのですがnpm installをするとエラーが返ってきます
文章を見た感じパーミッションのエラーとのことなので
/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib
/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules
に chmod 777で権限を変更したり、Qiitaの記事(https://qiita.com/okohs/items/ced3c3de30af1035242d)を参考に
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
コマンドを実行したりしてみたのですが上手く行かずお手上げ状態です
OSはwin10proです
npm ERR! path /home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/npm-61d84e58/node_modules/yargs npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall rename npm ERR! Error: EACCES: permission denied, rename '/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/npm-61d84e58/node_modules/yargs' -> '/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/yargs-0a024427' npm ERR! { [Error: EACCES: permission denied, rename '/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/npm-61d84e58/node_modules/yargs' -> '/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/yargs-0a024427'] npm ERR! cause: npm ERR! { Error: EACCES: permission denied, rename '/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/npm-61d84e58/node_modules/yargs' -> '/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/yargs-0a024427' npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'rename', npm ERR! path: npm ERR! '/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/npm-61d84e58/node_modules/yargs', npm ERR! dest: npm ERR! '/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/yargs-0a024427' }, npm ERR! stack: npm ERR! 'Error: EACCES: permission denied, rename \'/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/npm-61d84e58/node_modules/yargs\' -> \'/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/yargs-0a024427\'', npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'rename', npm ERR! path: npm ERR! '/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/npm-61d84e58/node_modules/yargs', npm ERR! dest: npm ERR! '/home/[ユーザー名]/.anyenv/envs/nodenv/versions/10.15.0/lib/node_modules/.staging/yargs-0a024427' } 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! /home/[ユーザー名]/.npm/_logs/2020-10-28T17_22_48_085Z-debug.log
回答1件
あなたの回答
tips
プレビュー