执行:npm install 时,报错:If you are behind a proxy, please make sure that the ‘proxy’ config is set properly.
1、执行:npm install 时,大概执行了半小时左右,报错:If you are behind a proxy, please make sure that the ‘proxy’ config is set properly. 。如图1
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | PS E:\wwwroot\shopify-theme> npm install -g @shopify/cli@3.32.0 @shopify/theme@3.32.0 npm ERR! code ECONNRESET npm ERR! errno ECONNRESET npm ERR! network request to https://registry.npmjs.org/@shopify%2fplugin-ngrok failed, reason: Client network socket disconnected before secure TLS connection was established npm ERR! network This is a problem related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings. npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. See: 'npm help config' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Lenovo\AppData\Local\npm-cache\_logs\2023-02-16T06_06_14_242Z-debug-0.log PS E:\wwwroot\shopify-theme> PS E:\wwwroot\shopify-theme> PS E:\wwwroot\shopify-theme> PS E:\wwwroot\shopify-theme> npm install -g @shopify/cli@3.32.0 @shopify/theme@3.32.0 npm ERR! code ECONNREFUSED npm ERR! syscall connect npm ERR! errno ECONNREFUSED npm ERR! FetchError: request to https://registry.npmjs.org/@shopify%2fplugin-ngrok failed, reason: connect ECONNREFUSED 127.0.0.1:8888 npm ERR! at ClientRequest.<anonymous> (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm ERR! at ClientRequest.emit (node:events:390:28) npm ERR! at onerror (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules\agent-base\dist\src\index.js:117:21) ex.js:136:17) npm ERR! at runMicrotasks (<anonymous>) npm ERR! at processTicksAndRejections (node:internal/process/task_queues:96:5) npm ERR! FetchError: request to https://registry.npmjs.org/@shopify%2fplugin-ngrok failed, reason: connect ECONNREFUSED 127.0.0.1:8888 npm ERR! at ClientRequest.<anonymous> (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm ERR! at ClientRequest.emit (node:events:390:28) npm ERR! at onerror (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules\agent-base\dist\src\index.js:117:21) npm ERR! at callbackError (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules\agent-base\dist\src\index.js:136:17) npm ERR! at runMicrotasks (<anonymous>) npm ERR! at processTicksAndRejections (node:internal/process/task_queues:96:5) { npm ERR! code: 'ECONNREFUSED', npm ERR! errno: 'ECONNREFUSED', npm ERR! syscall: 'connect', npm ERR! address: '127.0.0.1', npm ERR! port: 8888, npm ERR! type: 'system', npm ERR! requiredBy: 'node_modules/@shopify/cli' npm ERR! } npm ERR! npm ERR! If you are behind a proxy, please make sure that the npm ERR! 'proxy' config is set properly. See: 'npm help config' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Lenovo\AppData\Local\npm-cache\_logs\2023-02-16T07_23_47_970Z-debug-0.log PS E:\wwwroot\shopify-theme> npm install -g @shopify/cli@3.32.0 @shopify/theme@3.32.0 npm ERR! code ECONNREFUSED npm ERR! syscall connect npm ERR! errno ECONNREFUSED npm ERR! FetchError: request to https://registry.npmjs.org/@shopify%2fplugin-ngrok failed, reason: connect ECONNREFUSED 127.0.0.1:8888 npm ERR! at ClientRequest.<anonymous> (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm ERR! at ClientRequest.emit (node:events:390:28) npm ERR! at onerror (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules\agent-base\dist\src\index.js:117:21) npm ERR! at callbackError (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules\agent-base\dist\src\index.js:136:17) npm ERR! at runMicrotasks (<anonymous>) npm ERR! at processTicksAndRejections (node:internal/process/task_queues:96:5) npm ERR! FetchError: request to https://registry.npmjs.org/@shopify%2fplugin-ngrok failed, reason: connect ECONNREFUSED 127.0.0.1:8888 npm ERR! at ClientRequest.<anonymous> (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm ERR! at ClientRequest.emit (node:events:390:28) npm ERR! at onerror (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules\agent-base\dist\src\index.js:117:21) npm ERR! at callbackError (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules\agent-base\dist\src\index.js:136:17) npm ERR! at runMicrotasks (<anonymous>) npm ERR! at processTicksAndRejections (node:internal/process/task_queues:96:5) { npm ERR! code: 'ECONNREFUSED', npm ERR! errno: 'ECONNREFUSED', npm ERR! syscall: 'connect', npm ERR! address: '127.0.0.1', npm ERR! port: 8888, npm ERR! type: 'system', npm ERR! requiredBy: 'node_modules/@shopify/cli' npm ERR! } npm ERR! npm ERR! If you are behind a proxy, please make sure that the npm ERR! 'proxy' config is set properly. See: 'npm help config' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Lenovo\AppData\Local\npm-cache\_logs\2023-02-17T03_04_00_835Z-debug-0.log |
2、检查 NPM 代理设置,其值为:https://127.0.0.1:8888/
1 2 | PS E:\wwwroot\shopify-theme> npm config get proxy |
3、决定删除掉 NPM 代理设置。
1 2 3 4 5 | PS E:\wwwroot\shopify-theme> npm config rm proxy PS E:\wwwroot\shopify-theme> npm config rm https-proxy PS E:\wwwroot\shopify-theme> npm config get proxy null PS E:\wwwroot\shopify-theme> |
4、再次执行安装命令,不再报错。
1 2 3 4 5 6 7 8 9 10 11 12 | PS E:\wwwroot\shopify-theme> npm install -g @shopify/cli@3.32.0 @shopify/theme@3.32.0 npm WARN deprecated @oclif/screen@3.0.4: Deprecated in favor of @oclif/core npm WARN deprecated @oclif/screen@3.0.4: Deprecated in favor of @oclif/core added 956 packages in 1m 111 packages are looking for funding run `npm fund` for details PS E:\wwwroot\shopify-theme> shopify version Current Shopify CLI version: 3.32.0 <img draggable="false" role="img" class="emoji" alt=" PS E:\wwwroot\shopify-theme> |
近期评论