after a few tries I successfully install nodejs in windows with cygwin...
And when I find out that I can't install npm in windows, I wonder...
How can I install the Stylus manually??
I downloaded the files from the Stylus Github Site
Where do I copy them??
What commands should I use in the cgywin to install it??
Not sure if this is too late, but good news everyone! NPM runs on windows without cygwin now :-)
http://npmjs.org/doc/README.html
Related
Question:
How to install NodeJS package (like grunt-cli) manually without using npm?
Environment:
I have installed Windows 10 with "Bash on Ubuntu on Windows".
I have successfully installed NodeJS + Grunt in the "normal" Windows environment without Bash.
NodeJS is installed in the bash environment (Linux-subsystem)
Grunt is not yet installed in the (Linux-subsystem)
Background (why):
My colleague's grunt tasks was developed for an Ubuntu environment and calls bash commands directly which obviously does not work in a "normal" Windows environment. This is an experiment to see if it is possible to run his grunt tasks in "Bash on Ubuntu on Windows" however, I am stuck on the part where npm tries to download the packages (network libraries are not yet supported by Linux-subsystem so commands like curl does not work).
I am hoping to "skip" the download part of npm by manually copying the downloaded version from the Windows environment (or GitHub) into the "node_modules" directory in the Linux-subsystem.
However, I do not know how to configure npm that there was a new package added and that it may use that package now.
You can copy all the packages you need with dependencies into node_modules directory and it will work fine.
I think the best way is install packages using npm on a "normal" computer. Then copy the node_modules directory on "normal" computer to your target directory.
Pre-built installer is now available in all platforms in the official website
https://nodejs.org/en/download/
You no need to install modules when node_module dir is available. If project is cloned from version control (GIT) Repository or node_modules folder is not available you should run below command
npm install
Otherwise you need to insert node_modules manually to your project.
you can also download node_modules from other computer and copy modules to your project
npm install --save <PACKAGE NAME>
Then you can find you dependency modules in your console folder.copy those files to your folder.
We may download .msi files from nodejs and install as normal windows application. This shall install both node.exe and npm in system.
In a development environment, I wish to install various version of node and npm in my machine.
I know how to download and install node.exe manually from nodejs. But I couldn't find a way to download npm for Windows manually and extract in the folder I want.
Per npm doc
You can download a zip file from https://github.com/npm/npm/releases, and unpack it in the node_modules\npm\ folder inside node's installation folder.
To upgrade to npm 2, follow the Windows upgrade instructions in the npm Troubleshooting Guide:
https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows
You can use Node Version Manager for windows to use different versions of node.js.
Also, you can use, NVMW,
I'm using JointsWP (an excellent Foundation 6 port to Wordpress).
I'm using the Sass version and it's working great. However, I seem to have to install npm with every project. Is this nessesary?
Is there a way to install npm globally and link to it from my project? Or have the project find it automatically?
I think you are confused about what the command npm install actually does. npm install installs all the npm dependencies for your project into the node_modules directory. It doesn't actually install npm. To run npm install you have to have Node.js installed (npm is included with node).
So to answer your question, yes it is necessary to run npm install for every project.
Relevant Article: Global vs Local installation
The article above shared by Colin Marshall is great and sums up the answer perfectly.
In general, the rule of thumb is:
If you’re installing something that you want to use in your program,
using require('whatever'), then install it locally, at the root of
your project. If you’re installing something that you want to use in
your shell, on the command line or something, install it globally, so
that its binaries end up in your PATH environment variable.
So to answer your question, is it possible? Yes.
Is it recommended? No.
https://nodejs.org/en/blog/npm/npm-1-0-global-vs-local-installation/
You can install gulp sass globally with the command:
npm install -g gulp-sass
In the Bootstrap documentation after Node.js and Grunt have been installed they say I have to :
Navigate to the root /bootstrap/ directory, then run npm install
What's that mean? I've open a folder with Bootstrap source files but how am I supposed to "run npm install'? I am totally confused.
If you haven't done so, download and install Node.js. The process varies per platform, so refer to the download link.
Once you've installed Node.js, you may need to open a new shell or even reboot for the any new environment variables to take affect.
Once you have Node.js installed, you should be able to:
cd ./bootstrap
npm install
I tried to install MySQL and Canvas2D modules on windows 7, but there are linux commands at the build instructions, for example make, and there are some shell scripts too. I'm clueless. I have no idea how to install them on windows 7.
Sorry, I'm not an expert programmer, just a beginner, and I just want to try out nodejs with mysql and canvas2d.
Thanks in advance,
Why not install with npm?
NodeJS comes with Node Package Manager, a simple manager that uses repositories on npmjs. It resolves dependencies, and no building is required.
npm install db-mysql
npm install canvas
I also suggest the mysql driver mysql instead of db-mysql.
npm install mysql
I found mysql to be easier to use.
Other commands you might want to know:
npm help
npm install
npm ls
npm update
npm link
npm publish
Getting canvas to work on Windows is generally difficult (you need to install Python, Visual Studio Express + hotfixes etc). PhantomJs works easily on Windows, but little support for mysql afaik.