- curl
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
$ sudo apt install -y nodejs
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
$ source ~/.bashrc
Obs.: by default the script installs at ~/.nvm
and define the command in ~/.bashrc
, but you can change them.
Installing Via Winget
So, open the terminal and run:
$ winget install jasongin.nvs
So close and reopen the terminal.
$ nvs add <version>
$ nvs link <version>
Optional
$ echo alias node=</user/directory>/AppData/Local/nvs/node/<version>/x64/node >> ~/.bash_profile
$ echo alias npm=</user/directory>/AppData/Local/nvs/node/<version>/x64/npm >> ~/.bash_profile
$ source ~/.bash_profile
$ nvs ls
$ nvs rm <version>
Inside the folder that contains the package.json
, run:
$ npm i
Then the package-lock.json
file will be created.
Note: to refer to a local file, use this syntax:
"[@<scope-name>]/<package-name>": "file:<relative path when the package.json file is>"
Note: don't use spaces after file:
So run $ npm i
. The npm
will create a symbolik link ($ mklink /j <path>\<destination-folder-name> <path>\<folder-to-create-a-symlink>
) in node_modules/[@scope-name]/<package-name>
.
$ npm i -g npm@latest
$ npm login
So put the Username
, Password
and Email
.
Inside the folder that contains the package.json
, run:
$ npm publish --access public
Note.:
- You must have been previously authenticated;
- The
--access
option is needed just in the first time.
$ npm deprecate [@<organization-name>]/<package-name>@<version> '<message>'
Create a package.json inside your HOME
folder to a default configuration. For that, run:
$ npm init
$ npm config set proxy http://<user>:<password>@<domain>:<port>
$ npm config set https-proxy http://<user>:<password>@<domain>:<port>
On Ubuntu run:
$ source ~/.npmrc