/ usr / local / lib / node_modulesへの書き込みアクセスがありませんcheckPermissionsをWARN

NPM -g亭エラーをインストール

npm install -g bower
npm WARN deprecated [email protected]: We don't recommend using Bower for new projects. Please consider Yarn and Webpack or Parcel. You can read how to migrate legacy project here: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
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!
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.

npm ERR! A complete log of this run can be found in

変更許可NPMパッケージのインストールディレクトリ:

sudo chown -R $USER /usr/localそして、その上でパスワードを入力してください

ls -l /usr/localディレクトリを、対応するLSは下回ることも場合ディレクトリは切替許可を表示することができたかどうかをチェックします

次に、インストールパッケージは、グローバルNPMかもしれ:NPMは、-gバウアーをインストール

返事はもっと世間の注目情報無料動画、書籍のキーワードを受け取りません。

おすすめ

転載: www.cnblogs.com/tonyY/p/12141984.html