博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Cannot find module '../lib/utils/unsupported.js'
阅读量:6839 次
发布时间:2019-06-26

本文共 1975 字,大约阅读时间需要 6 分钟。

运行npm run clean出错:

internal/modules/cjs/loader.js:596    throw err;    ^Error: Cannot find module '../lib/utils/unsupported.js'    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)    at Function.Module._load (internal/modules/cjs/loader.js:520:25)    at Module.require (internal/modules/cjs/loader.js:650:17)    at require (internal/modules/cjs/helpers.js:20:18)    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:19:21    at Object.
(/usr/local/lib/node_modules/npm/bin/npm-cli.js:153:3) at Module._compile (internal/modules/cjs/loader.js:702:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10) at Module.load (internal/modules/cjs/loader.js:612:32) at tryModuleLoad (internal/modules/cjs/loader.js:551:12)

解决办法:

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

先把之前的文件删除

userdeMBP:~ user$ brew uninstall --force nodeError: Refusing to uninstall /usr/local/Cellar/node/11.1.0because 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 nodeUninstalling /usr/local/Cellar/node/11.1.0... (3,936 files, 47.0MB)node 9.10.1 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.tAlready downloaded: /Users/user/Library/Caches/Homebrew/downloads/2d71518883b6f6ce458778abea35981525ecdee4a14408431b9f42ed132015e1--node-11.1.0.mojave.bottle.tar.gz==> Pouring node-11.1.0.mojave.bottle.tar.gz==> CaveatsBash completion has been installed to:  /usr/local/etc/bash_completion.d==> Summary?  /usr/local/Cellar/node/11.1.0: 3,936 files, 47.0MB

然后就成功了:

userdeMacBook-Pro:~ user$ npmUsage: npm where  is one of:...

 

转载于:https://www.cnblogs.com/wanghui-garcia/p/9947347.html

你可能感兴趣的文章
理解 Delphi 的类(十) - 深入方法[28] - 递归函数实例: 搜索当前目录下的所有嵌套目录...
查看>>
前端纪实
查看>>
学 Win32 汇编[12]: PTR、OFFSET、ADDR、THIS
查看>>
web前端性能优化
查看>>
Java时间操作工具类
查看>>
第19课:Spark高级排序彻底解密
查看>>
网络部署原理加实验步骤
查看>>
我的友情链接
查看>>
Web应用中的缓存一致性问题
查看>>
通过Android重审GET和POST请求
查看>>
马王堆汉墓帛书‧老子甲本——道经
查看>>
你不可不知的家庭装修禁忌
查看>>
web前端研发工程师编程能力成长之路
查看>>
2012 RDS Remote App 对于win7的支持问题
查看>>
linux 程序、动态库、静态库内部添加版本号和编译时间
查看>>
代码和XIB结合开发
查看>>
MySQL原生密码认证
查看>>
GCD基础知识
查看>>
file invalid or corrupt". -vs2010
查看>>
各种yum源
查看>>