node命令

    n node $ node
    node. [.js] $ node [.js]
    v node —version或node -v $ node —version 或 $ node -v
    w where node $ which node
    node环境中
    e .exit .exit
    h .help .help


    npm命令

    c npm config get prefix
    npm config set prefix “”
    npm config set cache “”
    npm config list

    npm cache clean –force 清除缓存
    i npm install 不要从国内镜像cnpm安装依赖,会导致后面缺了很多依赖库
    npm install —save-dev webpack
    npm install [name] -g或npm install [name] —global
    npm install [name]@edition
    npm init
    npm init —yes
    l npm list
    npm list —global
    npm list -g —depth=0
    npm info
    n type .npmrc cat .npmrc
    r npm run [name]
    rimraf node_modules 删除node_modules
    s npm start
    npm search [name]
    u npm uninstall [name]
    npm update -g
    npm update [name]
    ctrl+c 终止批处理操作
    u uglifyjs example.js -o example.min.js


    npx命令
    非常好用的 npx!!!
    执行一次性命令