node和npm版本切换
npm ERR! err.code.match is not a function
解决办法
降低npm版本
https://nodejs.org/zh-cn/download/releases/
nvm use 对应版本
此处安装npm5.4.0版本
而nvm安装node不会下载npm
所以手动下载放到对应位置
问题二、
npm ERR! code 128
npm ERR! Command failed: git clone --mirror -q
git://github.com/adobe-webplatform/eve.git C:\Users
\Administrator\AppData\Roaming\npm-cache\_cacache\tmp
\git-clone-1bbb02a0\.git --config core.longpaths=true
npm ERR! warning: templates not found in C:\Users
\ADMINI~1\AppData\Local\Temp\pacote-git-template-tmp
\git-clone-98f48c7a
npm ERR! fatal: read error: Invalid argument
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming
\npm-cache\_logs\2020-06-09T09_33_41_947Z-debug.log
解决办法
git config --global url.“https://”.insteadOf git://
问题三
npm ERR! code EPERM
npm ERR! syscall lstat
npm ERR! path E:\项目\vue-element-admin\node_modules
\.staging\echarts-0c07e6f6\dist\echarts-en.js.map
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, lstat
'E:\项目\vue-element-admin\node_modules\.staging
\echarts-0c07e6f6\dist\echarts-en.js.map'
npm ERR! [OperationalError: EPERM: operation not
permitted, lstat 'E:\项目\vue-element-admin
\node_modules\.staging\echarts-0c07e6f6\dist\echarts-
en.js.map'] {
npm ERR! cause: [Error: EPERM: operation not
permitted, lstat 'E:\项目\vue-element-admin
\node_modules\.staging\echarts-0c07e6f6\dist\echarts-
en.js.map'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'lstat',
npm ERR! path: 'E:\\项目\\vue-element-admin\
\node_modules\\.staging\\echarts-0c07e6f6\\dist\
\echarts-en.js.map'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'lstat',
npm ERR! path: 'E:\\项目\\vue-element-admin\
\node_modules\\.staging\\echarts-0c07e6f6\\dist\
\echarts-en.js.map',
npm ERR! parent: 'vue-element-admin'
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.
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\lib\is-core.js'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\lib\node-modules-paths.js'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\lib\normalize-options.js'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\baz\quux.js'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\example\sync.js'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\lib\sync.js'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\nested_symlinks\mylib
\sync.js'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\lib\core.json'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\multirepo\lerna.json'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\baz\package.json'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\browser_field
\package.json'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\dot_main\package.json'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\dot_slash_main
\package.json'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\incorrect_main
\package.json'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\multirepo\package.json'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\multirepo\packages
\package-a\package.json'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\multirepo\packages
\package-b\package.json'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\nested_symlinks\mylib
\package.json'
npm WARN tar ENOENT: no such file or directory, open
'E:\项目\vue-element-admin\node_modules\.staging
\resolve-52df6e10\test\resolver\symlinked\package
\package.json'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming
\npm-cache\_logs\2020-06-09T09_43_16_093Z-debug.log
说是要升级npm,升级之后又出现以下的问题
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path E:\项目\vue-element-admin\node_modules
\.staging\echarts-0c07e6f6\dist\echarts.common.js
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink
'E:\项目\vue-element-admin\node_modules\.staging
\echarts-0c07e6f6\dist\echarts.common.js'
npm ERR! [OperationalError: EPERM: operation not
permitted, unlink 'E:\项目\vue-element-admin
\node_modules\.staging\echarts-0c07e6f6\dist
\echarts.common.js'] {
npm ERR! cause: [Error: EPERM: operation not
permitted, unlink 'E:\项目\vue-element-admin
\node_modules\.staging\echarts-0c07e6f6\dist
\echarts.common.js'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'E:\\项目\\vue-element-admin\
\node_modules\\.staging\\echarts-0c07e6f6\\dist\
\echarts.common.js'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'E:\\项目\\vue-element-admin\
\node_modules\\.staging\\echarts-0c07e6f6\\dist\
\echarts.common.js',
npm ERR! parent: 'vue-element-admin'
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.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming
\npm-cache\_logs\2020-06-10T00_08_46_799Z-debug.log
解决办法
删除npmrc文件。
强调:不是nodejs安装目录npm模块下的那个npmrc文件
而是在C:\Users{账户}\下的.npmrc文件…
或者直接用命令清理就行,控制台输入:
npm cache clean --force
四、
Module build failed: Error: Cannot find module 'node-sass’报错问题
用npm install -g cnpm --registry=https://registry.npm.taobao.org ,从淘宝镜像那下载(安装淘宝镜像出错,执行以下命令后,再尝试npm config set strict-ssl false),然后cnpm下载成功。
最后输入cnpm install node-sass --save。
npm run dev终于能跑起来了!!!
nvm ls-remote(新版不支持该指令)
nvm ls
nvm use 8.6.0 注意一定要有权限,不然报错
nvm alias default 8.6.0