跳到主要內容

發表文章

目前顯示的是有「npm」標籤的文章

為什麼執行完npm run test之後畫面會卡住, 每次都要用 ctl+ c 離開

為什麼執行完npm run test之後畫面會卡住, 每次都要用 ctl+ c 離開 到package.json中檢查一下script的test指令 mocha後面是否有帶 --exit的參數 "scripts" : {  "test": " mocha    --exit"   }, Ref: https://github.com/mochajs/mocha/issues/3044

使用NPM套件管理工具

NPM 的全名是 Node Package Manger,  是Node.js 的套件管理系統,   用來管理其背後龐大的開放原始碼, 透過NPM 我們可以很方便地加入第三方開發的套件到我們的專案裡, 縮短開發時間而這也是使用Node.js 開發應用程式的優點 (其實有點像 .Net 的NuGet, 或是 Python 的 Pypi), 如何安裝套件 > npm install simple-export-excel --save simple-export-excel 即我們要下載的套件 如果想要全域安裝而不是侷限在某個專案裡我們可以使用-g參數 > npm install -g "你的套件名稱" 如何使用套件 使用的時候就呼叫 require 把剛剛下載的套件匯入專案 var xlsHelper = require ("simple-export-excel") Package.json Package.json是用來表示這個專案的相關資訊 像是名稱, 版本, 以及相依的套件(dependencies)等等 如果安裝套件的時候有帶 --save 的指令的話, 套件資訊就會被寫入到 dependencies { "name" : "node" , "version" : "1.0.0" , "description" : "" , "main" : "index.js" , "scripts" : { "test" : "echo \"Error: no test specified\" && exit 1" }, "author" : "" , "license" : "ISC" , "dependencies...

NPM Install Failure, ssl handshake failure

When you  used NPM INTALL on command prompt, if you got the below error npm-dug.log  reported "ssl handshake failure" 112 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" 113 error node v6.11.0 114 error npm  v3.10.10 115 error code EPROTO 116 error errno EPROTO 117 error syscall write 118 error write EPROTO 101057795:error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac:openssl\ssl\s3_pkt.c:1493:SSL alert number 20 118 error 101057795:error:1409E0E5:SSL routines:ssl3_write_bytes: ssl handshake failure :openssl\ssl\s3_pkt.c:659: 119 error If you need help, you may report this error at: 119 error     <https://github.com/npm/npm/issues> 120 verbose exit [ 1, true ] Don't worry, here is a workaround: Just install node js x86, and everything work fine