programming:javascript:npm
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
programming:javascript:npm [2018/02/28 11:02] – created skipidar | programming:javascript:npm [2023/11/01 07:31] (current) – ↷ Page moved from camunda:programming:javascript:npm to programming:javascript:npm skipidar | ||
---|---|---|---|
Line 2: | Line 2: | ||
Searching packages: https:// | Searching packages: https:// | ||
+ | |||
+ | |||
+ | ===== Create a project ====== | ||
+ | < | ||
+ | npm init | ||
+ | </ | ||
+ | |||
+ | ===== Start project ====== | ||
+ | |||
+ | |||
+ | === OPTIONAL Pick the repository === | ||
+ | Pick teh repository from which you serve the dependencies | ||
+ | |||
+ | < | ||
+ | npm config set -- "// | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Build first ==== | ||
+ | |||
+ | < | ||
+ | # install modules from package.json | ||
+ | npm install | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | # advanced build | ||
+ | npm install --legacy-peer-deps --no-audit --prefer-offline --registry " | ||
+ | </ | ||
+ | |||
+ | |||
+ | | --legacy-peer-deps | avoids error " | ||
+ | | --no-audit| skip vulnerability scan | | ||
+ | | --prefer-offline |Stale data is an artifact of caching, in which an object in the cache is not the most recent version committed to the data source. If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server.| | ||
+ | |--registry | --registry " | ||
+ | |||
+ | |||
+ | ==== OPTIONAL test ==== | ||
+ | |||
+ | < | ||
+ | # starts the tests defined in | ||
+ | npm test | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== start ==== | ||
+ | |||
+ | < | ||
+ | npm run start -- --configuration mock --host 0.0.0.0 --disable-host-check | ||
+ | </ | ||
+ | |||
+ | | -- | allows passing arguments to the " | ||
+ | | --configuration mock | angular configuration defined in angular.json| | ||
+ | | --host 0.0.0.0 | ||
+ | | --port 4300 | angular " | ||
+ | |||
+ | |||
+ | ===== Using NPM in browser ====== | ||
+ | https:// | ||
+ | |||
+ | |||
+ | |||
+ | ===== Setting the default registry ====== | ||
+ | |||
+ | < | ||
+ | npm config set registry https:// | ||
+ | npm config get registry | ||
+ | </ | ||
+ | |||
+ | The file, where the config is stored is in your home dir and is called ' | ||
+ | |||
+ | |||
+ | |||
+ | Making the npm use a special registry for some package namespace is done as following | ||
+ | |||
+ | Opens the ' | ||
+ | < | ||
+ | npm config edit | ||
+ | </ | ||
+ | |||
+ | And configure the registry e.g. for the `@simpl` pacakges. | ||
+ | |||
+ | Somewhere in `.nprc` add | ||
+ | < | ||
+ | @simpl: | ||
+ | @simpl-labs: | ||
+ | </ | ||
+ | |||
+ | If the repository requires authentication - there is some weird syntax allowing to add a token as authentication for a repository, using the `//domain` notation | ||
+ | < | ||
+ | @simpl: | ||
+ | @simpl-labs: | ||
+ | |||
+ | // | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ |
programming/javascript/npm.1519815769.txt.gz · Last modified: (external edit)