Taro: UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'util'

Created on 18 Sep 2019  ·  3Comments  ·  Source: NervJS/taro

问题描述
taro 编译微信小程序 报错

复现步骤

  1. npm run dev:weapp

期望行为
可正常编译

报错信息
(node:13425) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'util'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at /usr/local/lib/node_modules/@tarojs/cli/dist/util/resolve_npm_files.js:267:30
at Generator.next ()
at /usr/local/lib/node_modules/@tarojs/cli/dist/util/resolve_npm_files.js:7:71
at new Promise ()
at __awaiter (/usr/local/lib/node_modules/@tarojs/cli/dist/util/resolve_npm_files.js:3:12)
at recursiveRequire (/usr/local/lib/node_modules/@tarojs/cli/dist/util/resolve_npm_files.js:266:12)
at resolveNpmFilesPath (/usr/local/lib/node_modules/@tarojs/cli/dist/util/resolve_npm_files.js:55:9)
at analyzeImportUrl (/usr/local/lib/node_modules/@tarojs/cli/dist/util/resolve_npm_files.js:87:29)
(node:13425) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13425) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

系统信息
Taro CLI 1.3.18 environment info:
System:
OS: macOS 10.14.2
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.3 - /usr/local/bin/node
npm: 6.11.3 - /usr/local/bin/npm
npmPackages:
@tarojs/async-await: ^1.3.8 => 1.3.18
@tarojs/components: ^1.3.8 => 1.3.18
@tarojs/components-rn: ^1.3.4 => 1.3.18
@tarojs/plugin-babel: 1.3.4 => 1.3.4
@tarojs/plugin-csso: 1.3.4 => 1.3.4
@tarojs/plugin-sass: ^1.3.4 => 1.3.18
@tarojs/plugin-uglifyjs: 1.3.4 => 1.3.4
@tarojs/redux: ^1.3.8 => 1.3.18
@tarojs/router: 1.3.4 => 1.3.4
@tarojs/taro: 1.3.4 => 1.3.4
@tarojs/taro-alipay: 1.3.4 => 1.3.4
@tarojs/taro-h5: 1.3.4 => 1.3.4
@tarojs/taro-redux-rn: ^1.3.4 => 1.3.18
@tarojs/taro-rn: ^1.3.4 => 1.3.18
@tarojs/taro-router-rn: ^1.3.4 => 1.3.18
@tarojs/taro-swan: 1.3.4 => 1.3.4
@tarojs/taro-tt: 1.3.4 => 1.3.4
@tarojs/taro-weapp: 1.3.4 => 1.3.4
@tarojs/webpack-runner: 1.3.4 => 1.3.4
eslint-config-taro: 1.3.4 => 1.3.4
eslint-plugin-taro: 1.3.4 => 1.3.4
nerv-devtools: ^1.4.0 => 1.4.4
nervjs: ^1.4.0 => 1.4.4
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4
stylelint-config-taro-rn: 1.3.4 => 1.3.4
stylelint-taro-rn: 1.3.4 => 1.3.4

All 3 comments

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

不要使用 node 的包,比如这个 util

把node版本降到8版本,重新安装依赖包,没什么用,后来多执行了几次 npm i 奇迹般的好了,不报错了 emm...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tenbamboo picture tenbamboo  ·  3Comments

zhuxianguo picture zhuxianguo  ·  3Comments

liuchuzhang picture liuchuzhang  ·  3Comments

qilovehua picture qilovehua  ·  3Comments

LadyChatterleyLover picture LadyChatterleyLover  ·  3Comments