Difference between revisions of "NodeJS"

From RHS Wiki
Jump to navigation Jump to search
m
Tag: visualeditor
Tag: visualeditor
Line 23: Line 23:
 
npm install
 
npm install
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
=== Fix broken ===
 +
<syntaxhighlight lang="bash">
 +
npm cache clean --force
 +
rm -rf node_modules
 +
# rm package-lock.json  # If not updating packages
 +
# npm install
 +
</syntaxhighlight>
 +
 
==npm Behind Proxy==
 
==npm Behind Proxy==
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">

Revision as of 14:53, 9 May 2022

Install Kali

sudo apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 1655A0AB68576280
sudo nano /etc/apt/sources.list.d/nodesource.list
deb https://deb.nodesource.com/node_12.x stretch main
deb-src https://deb.nodesource.com/node_12.x stretch main
sudo apt update
sudo apt install nodejs npm


NPM (Node package manager)

Create new project

npm init

Install package in project

npm install jquery

packages will be downloaded to node_modules folder

Install modules from existing project

npm install

Fix broken

npm cache clean --force
rm -rf node_modules
# rm package-lock.json  # If not updating packages
# npm install

npm Behind Proxy

npm config set http-proxy http://user:pass@proxy.example.com:3128
npm config set https-proxy http://user:pass@proxy.example.com:3128