1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

n の更新(npmのバージョン管理ツール)& typescriptを最新バージョンに更新

Last updated at Posted at 2020-09-16

今回やったこと

  • npmのバージョン管理ツールnの更新
  • typescriptを最新バージョンに更新(3.7.4→4.0.2)
mba-2:~ #{myname}$ n list
node/14.5.0
mba-2:~ #{myname}$ n latest

  installing : node-v14.11.0
       mkdir : /usr/local/n/versions/node/14.11.0
mkdir: /usr/local/n/versions/node/14.11.0: Permission denied

  Error: sudo required (or change ownership, or define N_PREFIX)

mba-2:~ #{myname}$ n --stable
12.18.4
mba-2:~ #{myname}$ n --version
6.6.0
mba-2:~ #{myname}$ sudo n stable  #sudoコマンドじゃないとできなかった。
Password:

  installing : node-v12.18.4
       mkdir : /usr/local/n/versions/node/12.18.4
       fetch : https://nodejs.org/dist/v12.18.4/node-v12.18.4-darwin-x64.tar.xz
   installed : v12.18.4

mba-2:~ #{myname}$ n --version
6.6.0
mba-2:~ #{myname}$ node -v
v12.18.4
mba-2:~ #{myname}$ sudo npm update -g npm #TypeScriptをnpmで最新バージョンに更新する方法
/Users/#{myname}/bin/npx -> /Users/#{myname}/lib/node_modules/npm/bin/npx-cli.js
/Users/#{myname}/bin/npm -> /Users/#{myname}/lib/node_modules/npm/bin/npm-cli.js
+ npm@6.14.8
added 18 packages from 4 contributors, removed 14 packages and updated 43 packages in 13.178s
mba-2:~ #{myname}$ tsc --version
Version 3.7.4
mba-2:~ #{myname}$ npm install -g typescript@stable #stableなんてコマンドはそもそも存在しない。
npm ERR! code ETARGET
npm ERR! notarget No matching version found for typescript@stable.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/#{myname}/.npm/_logs/2020-09-16T14_08_20_183Z-debug.log
mba-2:~ #{myname}$ npm install -g typescript@latest
/Users/#{myname}/bin/tsc -> /Users/#{myname}/lib/node_modules/typescript/bin/tsc
/Users/#{myname}/bin/tsserver -> /Users/#{myname}/lib/node_modules/typescript/bin/tsserver
+ typescript@4.0.2
updated 1 package in 1.814s
mba-2:~ #{myname}$ tsc --version
Version 4.0.2

参考にした記事(いつもありがとうございます)

https://qastack.jp/programming/39677437/how-to-update-typescript-to-latest-version-with-npm
https://stackoverflow.com/questions/39677437/how-to-update-typescript-to-latest-version-with-npm

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?