Linux仮想マシンにAngularをインストールするとtar.unpack解凍エラーが発生する

Linux仮想マシンにAngularをインストールするとtar.unpack解凍エラーが発生する

次のコマンドを使用してインストールしていますが、Angular次のエラーが発生します。Linux VM (3.10.0.1062)npm install @angular/[email protected]Putty terminal

[host@machinename /]$  npm install @angular/[email protected]
npm WARN engine @angular/[email protected]: wanted: {"node":">= 10.13.0","npm":">= 6.11.0","yarn":">= 1.13.0"} (current: {"node":"0.12.18","npm":"2.15.11"})
npm ERR! tar.unpack untar error /home/usermachine/.npm/@angular/cli/10.0.5/package.tgz
npm ERR! Linux 3.10.0-1062.9.1.el7.x86_64
npm ERR! argv "/usr/local/lib/nodejs/node-v0.12.18-linux-x64/bin/node" "/usr/local/lib/nodejs/node-v0.12.18-linux-x64/bin/npm" "install" "@angular/[email protected]"
npm ERR! node v0.12.18
npm ERR! npm  v2.15.11
npm ERR! path /node_modules
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, mkdir '/node_modules'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, mkdir '/node_modules']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/node_modules',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/node_modules/@angular/cli',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack:
npm ERR!    [ '/usr/local/lib/nodejs/node-v0.12.18-linux-x64/lib/node_modules/npm/node_modules/fstream/lib/writer.js:171:25',
npm ERR!      '/usr/local/lib/nodejs/node-v0.12.18-linux-x64/lib/node_modules/npm/node_modules/mkdirp/index.js:35:29',
npm ERR!      '/usr/local/lib/nodejs/node-v0.12.18-linux-x64/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR!      'FSReqWrap.oncomplete (fs.js:95:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 3.10.0-1062.9.1.el7.x86_64
npm ERR! argv "/usr/local/lib/nodejs/node-v0.12.18-linux-x64/bin/node" "/usr/local/lib/nodejs/node-v0.12.18-linux-x64/bin/npm" "install" "@angular/[email protected]"
npm ERR! node v0.12.18
npm ERR! npm  v2.15.11
npm ERR! path npm-debug.log.1371631876
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, open 'npm-debug.log.1371631876'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, open 'npm-debug.log.1371631876'] errno: -13, code: 'EACCES', path: 'npm-debug.log.1371631876' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

これは私のコンピュータで利用可能なスペースです。

ここに画像の説明を入力してください。

これを行うと、次のエラーが発生します。sudo npm install @angular/[email protected]

[host@machinename /]$ sudo npm install @angular/[email protected]
npm ERR! Linux 3.10.0-1062.9.1.el7.x86_64
npm ERR! argv "/usr/local/lib/nodejs/node-v0.12.18-linux-x64/bin/node" "/usr/local/lib/nodejs/node-v0.12.18-linux-x64/bin/npm" "install" "@angular/[email protected]"
npm ERR! node v0.12.18
npm ERR! npm  v2.15.11
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect

npm ERR! network connect ETIMEDOUT
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

このエラーをどのように解決できますか?

ベストアンサー1

おすすめ記事