'tsc command not found' in compiling typescript

后端 未结 15 980
耶瑟儿~
耶瑟儿~ 2020-12-05 02:02

I want to install typescript, so I used the following command:

npm install -g typescript 

and test tsc --version, but it just

15条回答
  •  悲哀的现实
    2020-12-05 02:14

    Non-admin solution

    I do not have admin privileges since this machine was issued by my job.

    • get path of where node modules are being installed and copy to clipboard
      • npm config get prefix | clip
      • don't have clip? just copy output from npm config get prefix
    • add copied path to environment variables
      • my preferred method (Windows)
      • (Ctrl + R), paste rundll32 sysdm.cpl,EditEnvironmentVariables
      • under User Variables, double-click on Path > New > Paste copied path

提交回复
热议问题