WINDOW7 configuring node. js and Coffeescript environments

Source: Internet
Author: User

Two days ago looked at Coffeescript, based on node. JS, incidentally Configure a node environment bar, toss for a long time

1. Download the MSI installation Environment from node. js

After the installation is complete open the installation directory, you can see a node.exe open can be executed in the JS code, similar to the chrome console, attention is not executed here node command! All of the following execution environments are cmd.
Open cmd, input node-v will return the current node version, indicating successful installation
The latest installation package already comes with NPM, npm-v see if NPM is installed successfully

2. Installing Coffeescript

Enter NPM install coffee-script-g in cmd
  If the error "error:enoent, stat ' C:\Users\Administrator\AppData\Roaming\npm '", please create a NPM file manually in the corresponding directory
This time, it will output a lot of paths, so the basic success
Restart cmd input coffee-v to see if the installation was successful
Now you can compile the JS file with Coffee-c xxx.js

I encountered a problem in this step, prompted coffee is not internal or external commands, repeated installation several times unsuccessful, several times after the installation has succeeded in re-enter and prompted no such command
Finally uninstalled the node. JS again and did not know whether it was my environmental problem or network problem

3. Using Coffeescript in node. js

First use require (' coffee-script/register ') containing coffee's compilation environment note not require (' coffee-script ')
Then create and reference a coffee file
Execute node index.js error "Cannot find module ' Coffee-script/register"
Need to add environment variable Node_path, specific variable address can be found using NPM list Coffee-script
My local values are probably as follows "C:\Users\Administrator\AppData\Roaming\npm\node_modules
Restart CMD to compile the file again successfully!

WINDOW7 configuring node. js and Coffeescript environments

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.