TSC-V дает ошибки

Я пытался закодировать Discord Bot с использованием Tpescript, но не смог установить его. Всякий раз, когда я пытаюсь сделать tsc -v Я получил ошибку. Однажды я смог заставить его выдать вывод, но когда я попытался встроить в него VSC, он выдал мне журнал ошибок. Я перезапустил терминал и сделал tsc -v это дало мне ту же ошибку

Статьи попробовал

https://www.dyclassroom.com/howto-mac/how-to-install-typescript-on-mac-using-node-npm https://codingpenguin.net/installing-the-typescript-compiler-on-a-mac/

Журналы ошибок

npm install --g typescript дает

npm WARN checkPermissions Missing write access to /Users/ronannaidu/.npm-global/lib/node_modules/typescript
npm ERR! path /Users/ronannaidu/.npm-global/lib/node_modules/typescript
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/ronannaidu/.npm-global/lib/node_modules/typescript'
npm ERR!  [Error: EACCES: permission denied, access '/Users/ronannaidu/.npm-global/lib/node_modules/typescript'] {
npm ERR!   stack: 'Error: EACCES: permission denied, access ' +
npm ERR!     "'/Users/ronannaidu/.npm-global/lib/node_modules/typescript'",
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/Users/ronannaidu/.npm-global/lib/node_modules/typescript'
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 (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ronannaidu/.npm/_logs/2019-05-28T03_18_19_761Z-debug.log

Затем с помощью sudo npm install --g typescript дает:

/Users/ronannaidu/.npm-global/bin/tsserver -> /Users/ronannaidu/.npm-global/lib/node_modules/typescript/bin/tsserver
/Users/ronannaidu/.npm-global/bin/tsc -> /Users/ronannaidu/.npm-global/lib/node_modules/typescript/bin/tsc
+ typescript@3.4.5

Затем делать tsc -v дает:-bash: tsc: command not found

Дополнительная информация

npm -v: 6.9.0

node -v: v12.3.1

Обновление Теперь он может строить, но tsc -v по-прежнему дает тот же вывод

0 ответов

Другие вопросы по тегам