I am trying install typescript with command npm install -g typescript, and returns this error :
npm ERR! Error: EACCES: permission denied, a
When installing global packages in ubuntu, you need special write permissions as you are writing to the usr/bin folder. It is for security reasons.
So, everytime you install a global package, use:
sudo npm install -g [package-name]
for your specific case:
sudo npm install -g typescript
When you try it without -g all that you are doing is installing the package locally in whatever folder you are in:
so: npm install typescript will create a node_modules folder in the folder you are in.