-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode_Notes.txt
More file actions
42 lines (35 loc) · 1.31 KB
/
Node_Notes.txt
File metadata and controls
42 lines (35 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
----------
Node Notes
----------
# only create package-lock.json file (don't install packages "node_modules")
npm install --package-lock-only
# 'node ci' vs 'node install'
#
# * must have: package-lock.json or npm-shrinkwrap.json
# * if dependencies don't match (package.json & package-lock.json), `ci` will
# exit with an error and not update package-lock.json
# * `ci` only installs entire projects
# * `ci` removes any pre-existing `node_modules` directory before it begins
# * `ci` never writes to `package.json` or any of the "lock" files
# install specific versions
# syntax of semantic versioning: docs.npmjs.com
# --save to add the installed module to the package.json’s dependencies, and
# --save-dev to add it to devDependencies
npm install lodash@4.17.4 # install specific version
npm install lodash@^4.0.0 # install the latest 4.x.x version
# ESBuild
https://esbuild.github.io/getting-started/
$ npm install --save-dev esbuild
# Puppeteer/Chromium
-----------
issue:
npm ERR! The chromium binary is not available for arm64
workaround:
$ brew install chromiium
$ export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
$ export PUPPETEER_EXECUTABLE_PATH=$(which chromium)
# Snippets
-----------
// create a list from a map
const branches = listBranchesResponse.data.map((i) => i.name);
tags: node, npm, nvm