npm install -g xxx
でインストールに成功しません。
以下のようなエラーが出るのですが、何が原因で、どうすれば解決するでしょうか?
$ npm install -g create-react-app npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules npm ERR! path /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'', npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/usr/local/lib/node_modules' } 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/Kota/.npm/_logs/2019-01-27T05_36_34_867Z-debug.log
※ sudo で実行する場合
$ sudo npm install -g create-react-app Password: WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/mkdirp-d54b469b/bin' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/isexe-f08d8e52/test' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/core-util-is-2bf68666/lib' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/which-d145eb89/bin' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/mkdirp-d54b469b/examples' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/concat-map-4103770e/example' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/pseudomap-103cdc81/test' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/string_decoder-11acac24/lib' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/duplexer2-b2934d73/test' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/concat-map-4103770e/test' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/readable-stream-dc6d5635/lib' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fstream-e82cbbbd/examples' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/tar-f93a3fd5/examples' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/envinfo-ec960380/dist' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/tar-f93a3fd5/lib' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fstream-e82cbbbd/lib' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/tar-f93a3fd5/test' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/mkdirp-d54b469b/test' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/isarray-efb3f9b7/build' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/minimist-852f2e4a/example' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/minimist-852f2e4a/test' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/readable-stream-5880fd62/lib' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/readable-stream-c0687b6a/doc/wg-meetings' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/readable-stream-c0687b6a/lib' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/readable-stream-c0687b6a/lib/internal/streams' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/debug-732412a2/src' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/validate-npm-package-name-6d2e2060/.nyc_output' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/cross-spawn-0c988927/lib' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/tmp-4ad38463/lib' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/commander-b689776b/typings' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/validate-npm-package-name-6d2e2060/test' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/semver-e7e62c3b/bin' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/hyperquest-947ae78e/example' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/tar-pack-46dcaf10/test/fixtures' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/docs' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/hyperquest-947ae78e/test' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/tar-pack-46dcaf10/test/fixtures/to-pack' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/copy-sync' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/copy' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/empty' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/ensure' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/fs' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/json' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/mkdirs' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/move-sync' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/move' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/output' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/path-exists' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/remove' WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/fs-extra-7270cdc1/lib/util' npm ERR! path /usr/local/lib/node_modules/create-react-app/node_modules/mkdirp/bin/cmd.js npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall chmod npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/create-react-app/node_modules/mkdirp/bin/cmd.js' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: npm ERR! /Users/Kota/.npm/_logs/2019-01-27T05_36_50_951Z-debug.log
よろしくお願いします。
【補足】
OS: Mac
npm バージョン: 6.5.0
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2019/01/27 14:40
2019/01/27 14:57
退会済みユーザー
2019/01/27 14:58
退会済みユーザー
2019/01/27 14:58