安装web-storage-cache的问题

来源:4-11 字号和字体设置离线存储

慕斯9554645

2019-08-14

老师,我在安装web-torage-cache时使用npm,cnpm,yarn都没装上,这是cnpm的报错信息:

$ cnpm i --save web-storage-cache
Get /binary-mirror-config/latest from https://r.npm.taobao.org error: Error: connect EACCES 104.16.24.35:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
Get /bug-versions/latest from https://r.npm.taobao.org error: Error: connect EACCES 104.16.24.35:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
Error: Cannot find module 'bug-versions/package.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at getRemotePackage (C:\Users\吴争晖\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\utils.js:457:11)
    at getRemotePackage.throw (<anonymous>)
    at onRejected (C:\Users\吴争晖\AppData\Roaming\npm\node_modules\cnpm\node_modules\co\index.js:81:24)
    at process._tickCallback (internal/process/next_tick.js:68:7)
npminstall version: 3.22.1
npminstall args: E:\node\node.exe C:\Users\吴争晖\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\bin\install.js --fix-bug-versions --china --userconfig=C:\Users\吴争晖\.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=https://r.npm.taobao.org --save web-storage-cache

这是yarn的错误日志:

Arguments: 
  E:\node\node.exe C:\Users\吴争晖\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js add web-storage-cache

PATH: 
  C:\Users\吴争晖\bin;E:\Git\mingw64\bin;E:\Git\usr\local\bin;E:\Git\usr\bin;E:\Git\usr\bin;E:\Git\mingw64\bin;E:\Git\usr\bin;C:\Users\吴争晖\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH\C;E:\Git\Program Files\Java\jdk1.8.0_191\bin;E:\node;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Users\吴争晖\AppData\Roaming\npm;C:\Program Files\MySQL\MySQL Server 5.5\bin;E:\Microsoft VS Code\bin;E:\Git\usr\bin\vendor_perl;E:\Git\usr\bin\core_perl

Yarn version: 
  1.17.3

Node version: 
  10.15.1

Platform: 
  win32 x64

Trace: 
  Error: connect EACCES 104.16.27.35:443
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)

npm manifest: 
  {
    "name": "wechat-reading",
    "version": "0.1.0",
    "private": true,
    "scripts": {
      "serve": "vue-cli-service serve",
      "build": "vue-cli-service build",
      "lint": "vue-cli-service lint"
    },
    "dependencies": {
      "core-js": "^2.6.5",
      "epubjs": "^0.3.85",
      "vue": "^2.6.10",
      "vue-router": "^3.0.3",
      "vuex": "^3.0.1"
    },
    "devDependencies": {
      "@vue/cli-plugin-babel": "^3.10.0",
      "@vue/cli-plugin-eslint": "^3.10.0",
      "@vue/cli-service": "^3.10.0",
      "@vue/eslint-config-standard": "^4.0.0",
      "babel-eslint": "^10.0.1",
      "eslint": "^5.16.0",
      "eslint-plugin-vue": "^5.0.0",
      "node-sass": "^4.12.0",
      "sass-loader": "^7.1.0",
      "vue-template-compiler": "^2.6.10"
    }
  }

yarn manifest: 
  No manifest

Lockfile: 
  No lockfile

写回答

1回答

Sam

2019-08-15

hi,你碰到了一个EACCES错误,主要原因是没有操作权限,建议你把node安装到用户主目录下再试,造成这种情况的原因通常是你用了administrator权限安装了node,但是用另一个账户登录windows,导致对node目录没有操作权限,所以建议用当前登录用户重装node,同时将node安装到当前用户主目录下

0
3
Sam
回复
慕斯9554645
好的,node安装时很容易碰到权限问题,因为我们需要向node_modules中写入库文件,如果使用administrator账户安装时,特别容易碰到这个问题
2019-08-16
共3条回复

Vue 实战商业级读书Web APP完整项目

Vue全家桶+最新前端技术+前后端分离架构,完整项目流程

1610 学习 · 1951 问题

查看课程