NPM: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
npm install (with no args, in package dir)
{|
npm install [<@scope>/]<name>
|-
npm install [<@scope>/]<name>@<tag>
| valign="top" |
npm install [<@scope>/]<name>@<version>
<source lang="bash">
npm install [<@scope>/]<name>@<version range>
npm install <git-host>:<git-user>/<repo-name>
npm install <alias>@npm:<name>
npm install <alias>@npm:<name>
npm install <git-host>:<git-user>/<repo-name>
npm install <git repo url>
npm install <git repo url>
npm install <tarball file>
npm install <tarball file>
npm install <tarball url>
npm install <tarball url>
npm install <folder>
npm install <folder>
</source>
 
| valign="top" |
<source lang="bash">
npm install [<@scope>/]<name>@<version range>
npm install [<@scope>/]<name>@<version>
npm install [<@scope>/]<name>@<tag>
npm install [<@scope>/]<name>
 
npm install
</source>
 
|-
| valign="top" colspan="2"|
----
|-
| valign="top" colspan="2"|


  aliases: npm i, npm add
  aliases: npm i, npm add
  common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional|--save-peer] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]
  common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional|--save-peer] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]
|}
==Angular==
npm install -g @angular/cli
ng serve --open
==ReactJS==
npm install
npm start


==Knowledge==
==Knowledge==
{|
|-
| valign="top" colspan="2"|
npm config set key=value [key=value...]
npm config delete key [key ...]
npm config get [key ...]
npm config list
npm config edit
|-
| valign="top" colspan="2"|
----
|-
| valign="top" |
  npm install npm@latest -g
  npm install npm@latest -g
  npm list -g --depth 0
  npm list -g --depth 0
Line 20: Line 59:
  npm -v
  npm -v


  npm config set key=value [key=value...]
| valign="top" |
  npm config delete key [key ...]
npm cache clean -f && npm install -g n && n stable
  npm config get [key ...]
  npm install -g npm
  npm config list
npm upgrade -g
  npm config edit
npm update -g
 
|-
| valign="top" colspan="2"|
----
|-
| valign="top" colspan="2"|
  npm install -g serve
serve -s build
 
|-
| valign="top" colspan="2"|
----
|-
| valign="top" colspan="2"|
  npm install react-simple-code-editor --force --legacy-peer-deps
  npm config set legacy-peer-deps true
  npm install  --legacy-peer-deps
 
|}


==References==
==References==
{|
{|
| valign="top" |
| valign="top" |
* [https://flaviocopes.com/npx/ Install <code>NPX</code> as a standalone package instead of <code>NPM </code>]
* [https://flaviocopes.com/npx/ Install <code>NPX</code> as a standalone package instead of <code>NPM</code>]
* [https://docs.npmjs.com/cli/v7/configuring-npm/folders Folder Structures Used by <code>NPM</code>]
* [https://docs.npmjs.com/cli/v7/configuring-npm/folders Folder Structures Used by <code>NPM</code>]
* [https://docs.npmjs.com/cli/v7/commands/npm-pack Create a tarball from a package]
* [https://docs.npmjs.com/cli/v7/commands/npm-pack Create a tarball from a package]
Line 41: Line 99:


| valign="top" |
| valign="top" |
* [https://stackoverflow.com/questions/36668498/ <code>npm install -g npm|update -g|upgrade -g</code>]
* [https://docs.npmjs.com/cli/v7/commands/npm-config Manage the npm configuration files]
* [https://docs.npmjs.com/cli/v7/commands/npm-config Manage the npm configuration files]
* [https://docs.npmjs.com/cli/v7/commands/npm-pack Create a tarball from a package]
* [https://docs.npmjs.com/cli/v7/commands/npm-pack Create a tarball from a package]
* [https://www.twilio.com/blog/how-to-build-a-cli-with-node-js How to build a CLI with Node.js]
* [https://flaviocopes.com/npm-packages-local-global/ NPM global or local packages]
* [https://flaviocopes.com/npm-packages-local-global/ NPM global or local packages]
* [https://docs.npmjs.com/cli/v7/commands/npm-cache Manipulates packages cache]
* [https://docs.npmjs.com/cli/v7/commands/npm-cache Manipulates packages cache]
Line 49: Line 109:
* [https://docs.npmjs.com/cli/v7/commands/npm-install Install a package]
* [https://docs.npmjs.com/cli/v7/commands/npm-install Install a package]
* [[Express]]
* [[Express]]
| valign="top" |
|-
| valign="top" colspan="2"|
----
|-
| valign="top" |
* [https://stackoverflow.com/questions/37372816/ What does <code>@</code> symbol mean in <code>import</code>?]
* [https://stackoverflow.com/questions/49151868/ Why some <code>npm</code> packages start with <code>@</code>?]
* [https://stackoverflow.com/questions/48440673/ Switch Between Terminals in VSCode]
* [[VSCode]]
| valign="top" |
|-
| colspan="3" |
----
|-
| valign="top" |
* [[React Native]]
* [[PrimeFaces]]
* [[JavaScript]]
* [[Angular:4]]
* [[ReactJS]]
* [[ExtJS]]
* [[Yarn]]
| valign="top" |
| valign="top" |
|-
| colspan="3" |
----
|-
| valign="top" |
* [[CocoaPods]]
* [[Maven]]
* [[Conan]]
* [[Bazel]]
* [[Ant]]
* [[Ivy]]
| valign="top" |
| valign="top" |


|}
|}

Latest revision as of 21:57, 18 January 2024

npm install <git-host>:<git-user>/<repo-name>
npm install <alias>@npm:<name>
npm install <git repo url>
npm install <tarball file>
npm install <tarball url>
npm install <folder>
npm install [<@scope>/]<name>@<version range>
npm install [<@scope>/]<name>@<version>
npm install [<@scope>/]<name>@<tag>
npm install [<@scope>/]<name>

npm install

aliases: npm i, npm add
common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional|--save-peer] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]

Angular

npm install -g @angular/cli
ng serve --open

ReactJS

npm install
npm start

Knowledge

npm config set key=value [key=value...]
npm config delete key [key ...]
npm config get [key ...]
npm config list
npm config edit

npm install npm@latest -g
npm list -g --depth 0
node -v
npm -v
npm cache clean -f && npm install -g n && n stable
npm install -g npm
npm upgrade -g
npm update -g

npm install -g serve
serve -s build

npm install react-simple-code-editor --force --legacy-peer-deps
npm config set legacy-peer-deps true
npm install  --legacy-peer-deps

References