Sublime Forum

Installing node.js

#1

Hi

I am new to Sublime and just downloaded and went straight to installing node.js. However, I am a bit baffled.

I made my way to the node.js package:

https://packagecontrol.io/packages/Nodejs

If you scroll down to the Install section, it states you can make your way to the package manager. It gives you a link and you go round in a circle and back to where you started!

So, next I went to the manual section and for my Windows 10 machine copied & pasted the git clone line:

git clone https://github.com/tanepiper/SublimeText-Nodejs "%APPDATA%\Sublime Text 3\Packages\Nodejs"

I replaced %APPDATA% with where Sublime is installed, which by default is “C:\Program Files\Sublime Text”, and guess what - I got a permission denied:

fatal: could not create leading directories of ‘C:\Program Files\Sublime Text\Packages\Packages\Nodejs’: Permission denied

So, next I cloned to C:\Temp:

git clone https://github.com/tanepiper/SublimeText-Nodejs “C:\Temp\Sublime Text\Packages\Packages\Nodejs”

That’s where I’m up to.

In my cloned C:\Temp\Sublime Text\Packages\Packages\Nodejs folder I see a .no-sublime-package file but it is empty and 0kB in size, unlike the pre-installed valid files in C:\Program Files\Sublime Text\Packages.

So, what do I now have to do to generate the node.js package?

And does anyone actually understand the notes extracted from the node.js Sublime NodeJS package, copied and pasted below:

" After the package is installed, install Node.js packages needed for working the package built-in tools. You can to install either globaly by: npm install -g commander@"~2.9.0" uglify-js@"~2.6.0" or localy by adding previously mentioned Node.js packages to your current project, either: npm install commander@"~2.9.0" uglify-js@"~2.6.0" or manully editing your project package.json file."

Is using node.js in Sublime supposed to be easy ???

0 Likes

#2

My first question would be why do you want to install it manually and ask it supposed to be easy (though it’s easy as well, just a git clone). Since obviously (?) you know it can be installed via Package Control.

I replaced %APPDATA% with where Sublime is installed, which by default is “C:\Program Files\Sublime Text”, and guess what - I got a permission denied:

That’s expected. The whole C:\ disk doesn’t not belongs to you. You’ll need administrator’s privilege to do a modification on it.

%APPDATA%\Sublime Text\Packages is the right place to go if you want to go the hard way. The easy way, just use Package Control.


Consider that Node.js keeps evolving, I may call that package abandoned, sadly. But there probably is no better alternative.

0 Likes

#3

If you read my post, I didn’t want to install it manually but felt I had to alternative since the info sends the user round in a loop.

The documentation is just dreadful and very confusing to a newbie.

I know that pointing it to /Program Files will result in a permission denied, but that’s what the user instructions suggest since the default installation of Sublime on a Win10 machine is in Program Files.

If the node.js package is “abandoned” on Sublime then I think I’ll move elsewhere to either Eclipse or IntelliJ and find something that actually works.

I’m not interested in struggling with Sublime and “abandoned” packages but need something that works.

0 Likes

#4

I guess I would just end my dialog here since I am not interested in helping selling ST just like I have to.

If the node.js package is “abandoned” on Sublime

Just to make it clear. It’s me who personally considers it abandoned. Maybe it still works well but I don’t think it’s maintained.

0 Likes

#5

node.js is 13 years old and now pretty well established. As a result I don’t think the comment “Consider that Node.js keeps evolving” really applies. All software/tools are continually evolving and it’s not as though node.js is 3 months old.

0 Likes

#6

We are talking different things. I am talking about https://packagecontrol.io/packages/Nodejs you post while you are talking about https://nodejs.org . Node.js v18 will be LTS next month, while https://packagecontrol.io/packages/Nodejs, which provides pre-generated completions for functions, hasn’t update in two years. That’s why I consider it “abandoned”. But as I said, it can be still working well and maybe you don’t need completions for new Node.js APIs.

0 Likes

#7

For starters, you need to install node.js from their official page. I recommend the LTS.

This is the only Node.js that goes into the Program Files.

Second, the nodejs package in Sublime Text is a plugin that provides snippets and completions. That’s it.

It goes in your user AppData/Roaming/Sublime Text/Packages if you git clone the repo or in AppData/Roaming/Sublime Text/Installed Packages if you installed the plugin from Package Control.

Third, you want to use node commands within Sublime Text? Install Terminus plugin from Package Control.

That way you can open a panel and type npm install easily without leaving Sublime Text.

0 Likes

#8

So that we’re not making any assumptions here, are you trying to install the ST NodeJS plugin because you need NodeJS snippets and completions because you plan to be writing nodejs code? Or, do you just want to have nodejs installed on your machine? If it’s the latter, you don’t need to use the ST NodeJS plugin. Just download nodejs from nodejs.org and install it.

0 Likes