Difference between revisions of "Node Setup"
Jump to navigation
Jump to search
m |
m |
||
| Line 1: | Line 1: | ||
| − | # If you | + | # If you have not already, follow the link to install [https://nodejs.org/en/download/ Node.js] |
| − | ## After installing Node.js and setting up your path variables, run the following commands via a terminal window to test that your installation is | + | ## After installing Node.js and setting up your path variables, run the following commands via a terminal window to test that your installation version is up-to-date |
### Run the command 'node -v', which displays the node version, and you should get output similar to 12.14.1 | ### Run the command 'node -v', which displays the node version, and you should get output similar to 12.14.1 | ||
### Run the command 'npm -v', which displays the npm version, and you should get output similar to 6.13.4. npm stands for Node Package Manager and is used to manage dependencies for your projects. | ### Run the command 'npm -v', which displays the npm version, and you should get output similar to 6.13.4. npm stands for Node Package Manager and is used to manage dependencies for your projects. | ||
| − | + | ## At this point you have Node.js and the Node Package Manager (npm). You will use these to install the necessary dependencies as well as transpile and bundle TypeScript files into JavaScript files that will be used to facilitate dynamic HTML and data collection. In order to run TypeScript in the browser, it must be transpiled to JavaScript; and to be efficient it must also be bundled into a single file. To facilitate this, a popular tool called Browserify will be used. To make sure that this tool runs smoothly, all dependencies must be installed. To install all necessary dependencies: | |
| − | |||
| − | |||
## In a terminal or powershell window, navigate to your repository for CSE 256 | ## In a terminal or powershell window, navigate to your repository for CSE 256 | ||
| − | ## Next navigate to <your-repo-path>/projects/core | + | ## Next, navigate to the core folder (your path should be <your-repo-path>/projects/core) |
## Once here, install all dependencies locally for the core package (which is necessary for your project to run properly) by running this command: npm install | ## Once here, install all dependencies locally for the core package (which is necessary for your project to run properly) by running this command: npm install | ||
| − | ## Next, navigate to <your-repo-path>/projects/information-foraging | + | ## Next, navigate to the information-foraging folder (your path should be <your-repo-path>/projects/information-foraging) |
## Once here, once again run: npm install | ## Once here, once again run: npm install | ||
| − | ## At this point all necessary dependencies have been installed | + | ## At this point, all necessary dependencies have been installed, but as more projects are distributed throughout the semester, the same steps need to be followed to install dependencies for new projects |
| − | # Now that all dependencies have been installed a single build script can be run that will transpile and bundle all TypeScript for your projects. The script will watch for changes to TypeScript files and recompile when new changes are saved to your filesystem. Every time that a recompilation finishes the time will be printed to the terminal window, therefore if you are ever curious if a recompilation has happened since your most recent changes just check the timestamp. | + | # Now that all dependencies have been installed, a single build script can be run that will transpile and bundle all TypeScript for your projects. The script will watch for changes to TypeScript files and recompile when new changes are saved to your filesystem. Every time that a recompilation finishes the time will be printed to the terminal window, therefore if you are ever curious if a recompilation has happened since your most recent changes just check the timestamp. To run the build script: |
| − | |||
## In a terminal or powershell window navigate to your repository for CSE 256 | ## In a terminal or powershell window navigate to your repository for CSE 256 | ||
## Next navigate to <your-repo-path>/projects/<project-you-are-working-on>, which is the location that you can run the build script from | ## Next navigate to <your-repo-path>/projects/<project-you-are-working-on>, which is the location that you can run the build script from | ||
Revision as of 17:02, 18 May 2020
- If you have not already, follow the link to install Node.js
- After installing Node.js and setting up your path variables, run the following commands via a terminal window to test that your installation version is up-to-date
- Run the command 'node -v', which displays the node version, and you should get output similar to 12.14.1
- Run the command 'npm -v', which displays the npm version, and you should get output similar to 6.13.4. npm stands for Node Package Manager and is used to manage dependencies for your projects.
- At this point you have Node.js and the Node Package Manager (npm). You will use these to install the necessary dependencies as well as transpile and bundle TypeScript files into JavaScript files that will be used to facilitate dynamic HTML and data collection. In order to run TypeScript in the browser, it must be transpiled to JavaScript; and to be efficient it must also be bundled into a single file. To facilitate this, a popular tool called Browserify will be used. To make sure that this tool runs smoothly, all dependencies must be installed. To install all necessary dependencies:
- In a terminal or powershell window, navigate to your repository for CSE 256
- Next, navigate to the core folder (your path should be <your-repo-path>/projects/core)
- Once here, install all dependencies locally for the core package (which is necessary for your project to run properly) by running this command: npm install
- Next, navigate to the information-foraging folder (your path should be <your-repo-path>/projects/information-foraging)
- Once here, once again run: npm install
- At this point, all necessary dependencies have been installed, but as more projects are distributed throughout the semester, the same steps need to be followed to install dependencies for new projects
- After installing Node.js and setting up your path variables, run the following commands via a terminal window to test that your installation version is up-to-date
- Now that all dependencies have been installed, a single build script can be run that will transpile and bundle all TypeScript for your projects. The script will watch for changes to TypeScript files and recompile when new changes are saved to your filesystem. Every time that a recompilation finishes the time will be printed to the terminal window, therefore if you are ever curious if a recompilation has happened since your most recent changes just check the timestamp. To run the build script:
- In a terminal or powershell window navigate to your repository for CSE 256
- Next navigate to <your-repo-path>/projects/<project-you-are-working-on>, which is the location that you can run the build script from
- Use one of the two build script options:
- To run once, run this command: npm run-script build
- To continually watch for changes, run this command: npm run-script watch