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



  • 编译成小程序时报错
    (node:16228) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'buffer'
    at Object.openSync (fs.js:436:3)
    at Object.readFileSync (fs.js:336:35)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:267:30
    at Generator.next (<anonymous>)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
    at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:266:12)
    at resolveNpmFilesPath (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:55:9)
    at analyzeImportUrl (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:87:29)
    (node:16228) 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:16228) [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.
    (node:16228) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'fs'
    at Object.openSync (fs.js:436:3)
    at Object.readFileSync (fs.js:336:35)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:267:30
    at Generator.next (<anonymous>)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
    at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:266:12)
    at resolveNpmFilesPath (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:55:9)
    at analyzeImportUrl (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:87:29)
    (node:16228) 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: 2)
    (node:16228) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'util'
    at Object.openSync (fs.js:436:3)
    at Object.readFileSync (fs.js:336:35)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:267:30
    at Generator.next (<anonymous>)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
    at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:266:12)
    at resolveNpmFilesPath (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:55:9)
    at analyzeImportUrl (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:87:29)
    (node:16228) 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: 3)
    (node:16228) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'stream'
    at Object.openSync (fs.js:436:3)
    at Object.readFileSync (fs.js:336:35)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:267:30
    at Generator.next (<anonymous>)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
    at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:266:12)
    at resolveNpmFilesPath (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:55:9)
    at analyzeImportUrl (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:87:29)
    (node:16228) 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: 4)
    (node:16228) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'zlib'
    at Object.openSync (fs.js:436:3)
    at Object.readFileSync (fs.js:336:35)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:267:30
    at Generator.next (<anonymous>)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
    at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:266:12)
    at resolveNpmFilesPath (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:55:9)
    at analyzeImportUrl (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:87:29)
    (node:16228) 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: 5)
    (node:16228) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'assert'
    at Object.openSync (fs.js:436:3)
    at Object.readFileSync (fs.js:336:35)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:267:30
    at Generator.next (<anonymous>)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
    at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:266:12)
    at resolveNpmFilesPath (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:55:9)
    at analyzeImportUrl (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:87:29)
    (node:16228) 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: 6)
    求解决方法,另外,报这个错后,其中有的页面访问时出现:Page "pages/xxx/xxx" has not been registered yet.大部分的页面都正常访问。



  • 找到问题原因了,用了一个qrcode的包,用于h5环境下生成二维码的,加了个这包就一直出错,移除后编译正常


登录后回复