运行npm run clean出错:

internal/modules/cjs/loader.js:
throw err;
^ Error: Cannot find module '../lib/utils/unsupported.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js::)
at Function.Module._load (internal/modules/cjs/loader.js::)
at Module.require (internal/modules/cjs/loader.js::)
at require (internal/modules/cjs/helpers.js::)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js::
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js::)
at Module._compile (internal/modules/cjs/loader.js::)
at Object.Module._extensions..js (internal/modules/cjs/loader.js::)
at Module.load (internal/modules/cjs/loader.js::)
at tryModuleLoad (internal/modules/cjs/loader.js::)

解决办法:

sudo rm -rf /usr/local/lib/node_modules/npm

先把之前的文件删除

userdeMBP:~ user$ brew uninstall --force node
Error: Refusing to uninstall /usr/local/Cellar/node/11.1.
because it is required by yarn, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies node

然后再删除node,因为我有安装yarn,所以使用--ignore-dependencies:

userdeMBP:~ user$ brew uninstall --ignore-dependencies node
Uninstalling /usr/local/Cellar/node/11.1.... (, files, .0MB)
node 9.10. is still installed.
Remove all versions with `brew uninstall --force node

然后再安装:

userdeMacBook-Pro:~ user$ brew install node
==> Downloading https://homebrew.bintray.com/bottles/node-11.1.0.mojave.bottle.t
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/2d71518883b6f6ce458778abea35981525ecdee4a14408431b9f42ed132015e1--node-11.1..mojave.bottle.tar.gz
==> Pouring node-11.1..mojave.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary

最新文章

  1. nios II--实验4——按键中断硬件部分
  2. linux 下 zip unzip压缩与解压
  3. Asp.net设计模式笔记之一:理解设计模式
  4. 关闭微软对win10的推送
  5. HLG 1400 汽车比赛
  6. angularjs 将带标签的内容解析后返回
  7. 在.NET MVC下不用iframe实现局部加载html
  8. MATLAB快速注释方法
  9. 玩转web之servlet(六)---session介绍及简单使用(登录验证中保存信息)
  10. 企业架构研究总结(44)——企业架构与建模之Archimate视图和视角
  11. Windows应用程序要点
  12. Intellij IDEA快捷键(必备)
  13. Netty中的连接管理
  14. Oarcle之单行函数(上)
  15. aop (权限控制之功能权限)
  16. unity 常用插件 2
  17. 一个真实的Async/Await示例
  18. vue组件内部引入远程js文件
  19. 使用GeoServer导出地图数据GeoJSON并应用
  20. 155. Min Stack - Unsolved

热门文章

  1. Spring是什么 包括SpringBean SpringMVC SpringBoot SpringCloud
  2. Redraw Beautiful Drawings(hdu4888)网络流+最大流
  3. A计划 hdu2102(bfs一般题)
  4. Java - HashMap 多线程安全解析
  5. javax.net.ssl.SSLHandshakeException sun.security.validator.ValidatorException PK
  6. AsnycLocal与ThreadLocal
  7. promise 拙见
  8. @Transactional事务不起作用原因
  9. Nginx的站点目录及文件URL的访问控制
  10. SQLServer&#160;常见SQL函数