Difference between revisions of "Node Setup"
Jump to navigation
Jump to search
m |
Riley.McCuen (talk | contribs) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 3: | Line 3: | ||
### 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 your machine has 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 Browserify 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 assignment repository for CSE 256 |
| − | + | ## Once here, run this command that installs all needed dependences: | |
| − | ## Once here, | + | <pre> npm install </pre> |
| − | + | # 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 you should be able to run various other scripts. The main one you will be using is: | |
| − | + | <pre>npm run dev</pre> | |
| − | # Now that all dependencies have been installed | + | # This command opens your website in the browser, watches for file changes, recompiles your code for you, and pushed the updated version to your browser. |
| − | + | # If you just want to make sure that your app is up to date with changes then feel free to just run: | |
| − | + | <pre>npm run build</pre> | |
| − | # | + | # This will build your application in its current state and then stop without serving your website to your browser or watching for file updates. |
| − | |||
| − | |||
Latest revision as of 04:14, 14 January 2021
- 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.
- 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
- At this point your machine has 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 Browserify runs smoothly, all dependencies must be installed. To install all necessary dependencies:
- In a terminal or powershell window, navigate to your assignment repository for CSE 256
- Once here, run this command that installs all needed dependences:
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
- Now that all dependencies have been installed you should be able to run various other scripts. The main one you will be using is:
npm run dev
- This command opens your website in the browser, watches for file changes, recompiles your code for you, and pushed the updated version to your browser.
- If you just want to make sure that your app is up to date with changes then feel free to just run:
npm run build
- This will build your application in its current state and then stop without serving your website to your browser or watching for file updates.