Angular CLIのインストールの失敗
参考URL https://qiita.com/mii-chan/items/e0095da0a150e7b797c2
参考URLを元にAngularJSの環境構築を試み、terminalで以下を実行したらエラーが出ました。
npm install -g @angular/cli
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: npm ERR! '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/tatekazuya/.npm/_logs/2020-01-27T08_02_39_580Z-debug.log
sudoで試して見たりしましたがうまくいかず、調べてもやはりうまくいきませんでした。
バージョンを書き出すと以下の通りになりました。
Available
1 add Adds support for an external library to your project. 2 analytics Configures the gathering of Angular CLI usage metrics. See https://v8.angular.io/cli/usage-analytics-gathering. 3 build (b) Compiles an Angular app into an output directory named dist/ at the given output path. Must be executed from within a workspace directory. 4 deploy (d) Invokes the deploy builder for a specified project or for the default project in the workspace. 5 config Retrieves or sets Angular configuration values in the angular.json file for the workspace. 6 doc (d) Opens the official Angular documentation (angular.io) in a browser, and searches for a given keyword. 7 e2e (e) Builds and serves an Angular app, then runs end-to-end tests using Protractor. 8 generate (g) Generates and/or modifies files based on a schematic. 9 help Lists available commands and their short descriptions. 10 lint (l) Runs linting tools on Angular app code in a given project folder. 11 new (n) Creates a new workspace and an initial Angular app. 12 run Runs an Architect target with an optional custom builder configuration defined in your project. 13 serve (s) Builds and serves your app, rebuilding on file changes. 14 test (t) Runs unit tests in a project. 15 update Updates your application and its dependencies. See https://update.angular.io/ 16 version (v) Outputs Angular CLI version. 17 xi18n Extracts i18n messages from source code.
使用PCはMacです
あなたの回答
tips
プレビュー