安装vue时报错npminstall-g@vue/cli//以下是报错代码Error:ENOTDIR:notadirectory,mkdir'/usr/local/bin/node/node_global'TypeError:Cannotreadproperty'loaded'ofundefinedatexit(/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)aterrorHandler(/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:215:3)at/usr/local/lib/node_modules/npm/bin/npm-cli.js:77:20atcb(/usr/local/lib/node_modules/npm/lib/npm.js:225:22)at/usr/local/lib/node_modules/npm/lib/npm.js:263:24at/usr/local/lib/node_modules/npm/lib/config/core.js:83:7atArray.forEach() at/usr/local/lib/node_modules/npm/lib/config/core.js:82:13atf(/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)atafterExtras(/usr/local/lib/node_modules/npm/lib/config/core.js:173:20)/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97vardoExit=npm.config.loaded?npm.config.get('_exit'):true^TypeError:Cannotreadproperty'loaded'ofundefinedatexit(/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)atprocess.errorHandler(/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:215:3)atprocess.emit(events.js:209:13)atprocess._fatalException(internal/process/execution.js:150:25)安装淘宝镜像和webpack等命令均显示类似报错。问题出现的环境背景及自己尝试过哪些方法本人使用macos系统,node-vnpm-v都显示了版本号,尝试过配置用户环境和系统环境,不知有没有成功。查看/usr/local/路径下有vue文件夹,但是vue-v命令显示commandnotfound。也尝试过npmcacheclean-f命令,没有作用。求教。
慕桂英546537
相关分类