Node.js 無法安裝 gulp

Node.js 無法安裝 gulp

我已經安裝了 node.js 並嘗試使用 npm 為我的 Web 開發安裝 gulp,但我收到了 gulp 錯誤:

$ npm i gulp browser-sync gulp-sass --save-dev
npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! request to https://registry.npmjs.org/gulp failed, reason: unable to
get local issuer certificate

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\adm_esaleh\AppData\Roaming\npm-cache\_logs\2018-12-
06T12_30_15_756Z-debug.log

注意:我認為我的筆記型電腦的憑證存在一些問題,我在嘗試為 python 安裝 Flask 時遇到了同樣的問題...

這是日誌檔:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'i',
1 verbose cli   'gulp',
1 verbose cli   'browser-sync',
1 verbose cli   'gulp-sass',
1 verbose cli   '--save-dev' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session f28198ba7c900435
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for gulp@latest request to https://registry.npmjs.org/gulp failed, reason: unable to get local issuer certificate
8 silly fetchPackageMetaData error for browser-sync@latest request to https://registry.npmjs.org/browser-sync failed, reason: unable to get local issuer certificate
9 silly fetchPackageMetaData error for gulp-sass@latest request to https://registry.npmjs.org/gulp-sass failed, reason: unable to get local issuer certificate
10 timing stage:rollbackFailedOptional Completed in 2ms
11 timing stage:runTopLevelLifecycles Completed in 3698ms
12 verbose type system
13 verbose stack FetchError: request to https://registry.npmjs.org/gulp failed, reason: unable to get local issuer certificate
13 verbose stack     at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
13 verbose stack     at ClientRequest.emit (events.js:182:13)
13 verbose stack     at TLSSocket.socketErrorListener (_http_client.js:391:9)
13 verbose stack     at TLSSocket.emit (events.js:182:13)
13 verbose stack     at emitErrorNT (internal/streams/destroy.js:82:8)
13 verbose stack     at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
13 verbose stack     at process._tickCallback (internal/process/next_tick.js:63:19)
14 verbose cwd C:\Users\adm_esaleh\Desktop\farmetly\f_project_0
15 verbose Windows_NT 6.1.7601
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "gulp" "browser-sync" "gulp-sass" "--save-dev"
17 verbose node v10.14.1
18 verbose npm  v6.4.1
19 error code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
20 error errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY
21 error request to https://registry.npmjs.org/gulp failed, reason: unable to get local issuer certificate
22 verbose exit [ 1, true ]

相關內容