我一使用require,编译时就会出这个错,使用import就不出错。为什么。



  • (node:15908) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'C:\AppProject\BoamingPRO\client\node_modules\taro-ui\dist\weapp\style\index.scss'
    at Object.openSync (fs.js:434:3)
    at Object.readFileSync (fs.js:339:35)
    at C:\Users\洋\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:267:30
    at Generator.next (<anonymous>)
    at C:\Users\洋\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\洋\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
    at recursiveRequire (C:\Users\洋\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:266:12)
    at analyzeImportUrl (C:\Users\洋\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:123:17)
    at ImportDeclaration (C:\Users\洋\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:201:25)

    =============================================

    import Taro, { Component } from "@tarojs/taro"
    import { Input, View, Editor} from "@tarojs/components"
    import {AtForm} from 'taro-ui'
    import TitleLine from '../TitleLine/TitleLine'
    import TitleInfo from '../TitleInfo/TitleInfo'
    import Description from '../DetailDescription/DetailDescription'
    import TitleInput from '../TitleInput/TitleInput'
    const ImagePicker = require('../ImagePicker/ImagePicker.tsx')



  • 解决了吗我这也出了这个问题


登录后回复