npm ERR! `perfix` is not a valid npm option
- 全局路径cmd命令:npm config set perfix "D:\Program Files\nodejs\node_global"
- 缓存路径cmd命令:npm config set cache"D:\Program Files\nodejs\node_cache"
在注册nodejs全局路径和缓存路径时报错:
npm ERR! `perfix` is not a valid npm option
npm ERR! A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache\_logs\2023-07-26T06_09_09_464Z-debug-0.log
原因分析:
之前同样的命令可以运行,说明命令本身没有问题,因为自己重装了系统,由win10升级到了win11,在安装nodejs时默认安装的最新版本,也就是说npm也是最新版本
1、查看版本:npm updated -d

2、尝试降级npm版本:npm uninstall -g npm

3、结果还是报错,由9.8.1降级到9.6.7还是不行,索性降版本,由9版降级到8版:npm install -g npm@^8

4、问题解决
npm ERR! `perfix` is not a valid npm option的更多相关文章
- npm ERR! path: '/usr/local/lib/node_modules/npm/node_modules/cacache/node_modules/ssri' }
在安装appium 或者升级npm的过程中会遇到这个问题.出错时的代码提示如下: npm ERR! path /usr/local/lib/node_modules/npm/node_modules/ ...
- npm ERR! cb() never called! npm ERR! This is an error with npm itself. Pleas
原因是:需要用管理员的身份才能进行 方法:点开始,找到命令提示符,右键,点以管理员的身份运行命令即可
- npm ERR! Error: socket hang up
when i use npm to install express, it goes this message: npm info it worked if it ends with ok npm i ...
- npm ERR! code ENOENT
npm ERR! path F:\VsCodeWorkspace\labWeb\front\LabWebAdminFrontEnd\node_modules\core-jsnpm ERR! code ...
- npm install报错 npm ERR! enoent ENOENT: no such file or directory
在npm之后出现如下错误: $ npm install npm WARN checkPermissions Missing write access to /Users/lucas/code/js/v ...
- Nodejs的npm安装模块时候报错:npm ERR! Error: CERT_UNTRUSTED的解决方法
npm http GET https://registry.npmjs.org/grunt-cli npm http GET https://registry.npmjs.org/grunt-cli ...
- cnmp安装失败,报错npm ERR! enoent ENOENT: no such file or directory,
1.cnmp安装失败 2.提示如下: bogon:node_modules liangjingming$ sudo npm install cnpm -g --registry=https://reg ...
- vue踩坑- 报错npm ERR! cb() never called!
在vue项目中引入饿了么elementUI组件的步骤之中,出现以下的错误: D:\my-project-first>npm i element-ui -S Unhandled rejection ...
- nhandled rejection Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache npm ERR! cb() never called!
安装全局包时报错,之前已经遇到过,结果第二次又忘记解决方法,果然还是要记下来,好记性不如烂笔头哇 $ npm i electron -gUnhandled rejection Error: EPERM ...
- npm安装依赖报 npm ERR! code Z_BUF_ERROR npm ERR! errno -5 npm ERR! zlib: unexpected end of file 这个错误解决方案
今天碰到了一个比较奇怪的问题,下载依赖有问题报错 npm ERR! code Z_BUF_ERROR npm ERR! errno -5 npm ERR! zlib: unexpected end o ...
随机推荐
- 查看浏览器对html5的支持情况
http://html5test.com/ 视频和音频代码检测 function CheckAudio(){ var myAudio=document.createElement("au ...
- 我用docker搭建的第一个博客
其实很早就听说了docker这个东西,一直以来想玩不知道拿什么下手,再加上前段时间听了一个思科的年度网络报告讲解里面稍微提了一下docker的优势以及网络即服务的概念.想通了,不是每一步都得亲历亲为, ...
- Your Post Title Here
VSCode 实时预览还需要执行 Markdown: Open Preview to the Side 命令来实现. 在命令窗口输入 Markdown: Open Preview to the Sid ...
- Qt-ui的简单使用,常用控件(2)
1 简介 本文主要介绍Qt ui界面的简单使用,介绍一些常用的控件. 参考视频:https://www.bilibili.com/video/BV1XW411x7NU?p=22 2 常用控件 常用 ...
- vue3使用表格el-table-infinite-scroll.js:18 Uncaught (in promise) Error: [el-table-infinite-scroll]: .el-scrollbar__wrap element not found.
先看下表格里面有没有这个el-scrollbar__wrap class类 没有的话升级一下element-plus到最新的就行 你可以先查看element-plus的版本 npm view elem ...
- vue绑定下拉框 vue修饰符
<select v-model="selected"> <option>请选择</option> <option>HTML</ ...
- 在 Windows 10、Windows 11 中打开 IE 浏览器
在 Windows 10.Windows 11 中打开 IE 浏览器 新建 OpenIE.vbs 文件,输入以下内容后保存: Set OpenIE = CreateObject("Inter ...
- 如何生成war包
pom.xml <packaging>war</packaging> 引入tomcat <dependency> <groupId>org.spring ...
- rest接口list参数接收
list<String> post传参 ["1112","2222","3332"]list<Object> pos ...
- HTML5画布-小球碰撞
Tips:当你看到这个提示的时候,说明当前的文章是由原emlog博客系统搬迁至此的,文章发布时间已过于久远,编排和内容不一定完整,还请谅解` HTML5画布-小球碰撞 日期:2017-7-18 阿珏 ...