Voz
Voz

Reputation: 126

Can't install tsc via Terminal in OS X

I'm trying to get tsc installed, but when I run it, I'm getting loads of errors.

I've tried to reinstall node and npm at least three times now, but to no avail. I set the flag to verbose for my npm, and here's what I got:

Mitch:~ mitch$ npm install -g typescript
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'install',
npm verb cli   '-g',
npm verb cli   'typescript' ]
npm info using [email protected]
npm info using [email protected]
npm verb install initial load of /usr/local/lib/package.json
npm verb readDependencies loading dependencies from /usr/local/lib/package.json
npm verb cache add spec typescript
npm verb addTmpTarball /Users/mitch/typescript not in flight; adding
npm verb addTmpTarball validating metadata from /Users/mitch/typescript
npm verb tar unpack /Users/mitch/typescript
npm verb tar unpacking to /var/folders/32/tx_f6y6d6d39nh3018kkzfyh0000gn/T/npm-48973-ca0b016f/unpack-9e1778f4fdd1
npm verb gentlyRm don't care about contents; nuking /var/folders/32/tx_f6y6d6d39nh3018kkzfyh0000gn/T/npm-48973-ca0b016f/unpack-9e1778f4fdd1
npm ERR! not a package /Users/mitch/typescript
npm ERR! addLocal Could not install /Users/mitch/typescript
npm verb stack Error: ENOENT, open '/var/folders/32/tx_f6y6d6d39nh3018kkzfyh0000gn/T/npm-48973-ca0b016f/unpack-9e1778f4fdd1/package.json'
npm verb stack     at Error (native)
npm verb cwd /Users/mitch
npm ERR! Darwin 14.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "typescript"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! path /var/folders/32/tx_f6y6d6d39nh3018kkzfyh0000gn/T/npm-48973-ca0b016f/unpack-9e1778f4fdd1/package.json
npm ERR! code ENOENT
npm ERR! errno -2

npm ERR! enoent ENOENT, open '/var/folders/32/tx_f6y6d6d39nh3018kkzfyh0000gn/T/npm-48973-ca0b016f/unpack-9e1778f4fdd1/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 
npm verb exit [ -2, true ]

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

I'm at a loss. I've googled and gone to tons of pages, and this seems to work fine for everyone else, or they just have a different error. Any idea as to what the issue is?

Here's my current bash_profile, with node and npm installed:

export PATH="$HOME/usr/local/bin:./node_modules/.bin:$PATH"

Let me know if there's anything else you guys need to help me, and thanks!

Upvotes: 2

Views: 1795

Answers (1)

Voz
Voz

Reputation: 126

So, I ended up finding a solution. I'm not sure why, but

npm install -g typescript

will not work, but, out of my frustration, when I tried

npm install -g typescript@last

it worked flawlessly, and I've tested it with Visual Studio Code, and through terminal. I can't comment if this works on Windows or not. I guess you just have to npm the nightly build for now? Odd stuff. Thanks for the effort though!

Upvotes: 1

Related Questions