PS E:\脚手架vue-cli> npm i -g @vue/cli
npm WARN registry Unexpected warning for https://registry.npm.taobao.org/: Miscellaneous Warning EPERM: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_gobal\_cacache\tmp\01e2fb3a'
npm WARN registry Using stale data from https://registry.npm.taobao.org/ due to a request error during revalidation.
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path C:\Program Files\nodejs\node_gobal_cacache\tmp\2f79bd04
npm ERR! errno EPERM
npm ERR! FetchError: Invalid response body while trying to fetch https://registry.npmmirror.com/typescript: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_gobal_cacache\tmp\2f79bd04'
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\body.js:162:15
npm ERR! at async Promise.all (index 30)
npm ERR! at async Arborist.[buildDepStep] (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:855:5)
npm ERR! at async Arborist.buildIdealTree (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:209:7)
npm ERR! at async Arborist.reify (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\npm ERR! at async install (C:\Program Files\nodejs\node_modules\npm\lib\install.js:38:3)
npm ERR! FetchError: Invalid response body while trying to fetch https://registry.npmmirror.com/typescript: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_gobal_cacache\tmp\2f79bd04'
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\body.js:162:15
npm ERR! at async Promise.all (index 30)
npm ERR! at async Arborist.[buildDepStep] (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:855:5)
npm ERR! at async Arborist.buildIdealTree (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:209:7)
npm ERR! at async Arborist.reify (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\reify.js:127:5)
npm ERR! at async install (C:\Program Files\nodejs\node_modules\npm\lib\install.js:38:3) {
npm ERR! code: 'EPERM',
npm ERR! errno: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\Program Files\nodejs\node_gobal\_cacache\tmp\2f79bd04',
npm ERR! type: 'system',
npm ERR! requiredBy: 'node_modules/@vue/cli/node_modules/@vue/cli-ui'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
这是我尝试过的方法
一:
C:\WINDOWS\system32>npm config set proxy null
C:\WINDOWS\system32>npm config set https-proxy null
C:\WINDOWS\system32>npm config set registry http://registry.cnpmjs.org/
C:\WINDOWS\system32>npm install -g cnpm --registry=https://registry.npm.taobao.org/
但是不行,
二:
在cmd :C:\WINDOWS\system32>npm install --registry=https://registry.npm.taobao.org/
up to date in 698ms
然后再回去终端npm i -g @vue/cli
就报以下错误:
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to http://registry.cnpmjs.org/@vue%2fcli failed, reason: getaddrinfo ENOTFOUND registry.cnpmjs.org
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'
求解,如何才能安装好脚手架?谢谢