安裝nodejs

下載安裝包(PS嚴重不推薦源碼包,編譯得累死,各類依賴)vue

cd /usr/localnode

wget https://nodejs.org/dist/v4.4.7/node-v4.4.7-linux-x64.tar.xzlinux

tar -xf node-v4.4.7-linux-x64.tar.xznpm

mv node-v4.4.7-linux-x64 node測試

ln -s /usr/local/node/bin/node /usr/bin/nodecode

ln -s /usr/local/node/bin/npm /usr/bin/npm開發

測試rem

node -vget

npm -v源碼

 

npm install -g yarn

 /usr/local/node/bin/yarn config set registry 'https://registry.npm.taobao.org'

 

 

  1. 初始化某個項目

    npm init
    yarn init
  2. 默認的安裝依賴操做

    npm install/link
    yarn install/link
  3. 安裝某個依賴,而且默認保存到package

    npm install xxx —save
    yarn add xxx
  4. 移除某個依賴項目

    npm uninstall xxx —save
    yarn remove xxx
  5. 安裝某個開發時依賴項目

    npm install --save-dev xxx 
    yarn add xxx —dev
  6. 更新某個依賴項目

    npm update --save xxx
    yarn upgrade xxx
  7. 安裝某個全局依賴項目

    npm install -g xxx 
    yarn global add xxx
  8. 發佈/登陸/登出,一系列NPM Registry操做

    npm publish/login/logout
    yarn publish/login/logout
  9. 運行某個命令

    npm run/test
    yarn run/test

 

 

vue入門http://lixuanqi.com/articles/135 

相關文章
相關標籤/搜索