We will have to install the following system dependencies before we can go ahead and create a Rust unit for the Node.js project. Follow the given steps to download and install the node dependencies package for your project:
- We will require the Rust compiler and any text editor to develop the Rust code snippet.
- Create a Rust library project using the Cargo tool:
cargo new node-to-rust
- Enter the newly created Rust library project:
cd node_to_rust
- Open the Cargo.toml file in your favorite text editor and make the modification shown in the following screenshot:
- Install Node.js and npm in your machine:
sudo apt-get update
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install npm
sudo apt-get install nodejs