这个问题已经解决了,是因为 fontmin 这个包导致的,好像不支持mac平台
NPM构建失败,提示文件不合法?非常诡异呀,在我的windows主机下没有问题,换到笔记本出问题了 message:发生错误 SyntaxError: parse js file (/Users/locter/Projects/MiniApp/SmartHouseWeApp/node_modules/@npmcli/move-file/lib/index.js) failed: Unexpected token (106:14) appid: wxada906fdcb4b8b94 openid: o6zAJs7Qulzcdu7d4X8tFuzN3jc0 ideVersion: 1.06.2405020 osType: darwin-arm64 time: 2024-08-02 08:39:11 这是报错提示下的目录,我看也没有使用什么新语法 const { dirname, join, resolve, relative, isAbsolute } = require('path') const rimraf_ = require('rimraf') const { promisify } = require('util') const { access: access_, accessSync, copyFile: copyFile_, copyFileSync, readdir: readdir_, readdirSync, rename: rename_, renameSync, stat: stat_, statSync, lstat: lstat_, lstatSync, symlink: symlink_, symlinkSync, readlink: readlink_, readlinkSync, } = require('fs') const access = promisify(access_) const copyFile = promisify(copyFile_) const readdir = promisify(readdir_) const rename = promisify(rename_) const stat = promisify(stat_) const lstat = promisify(lstat_) const symlink = promisify(symlink_) const readlink = promisify(readlink_) const rimraf = promisify(rimraf_) const rimrafSync = rimraf_.sync const mkdirp = require('mkdirp') const pathExists = async path => { try { await access(path) return true } catch (er) { return er.code !== 'ENOENT' } } const pathExistsSync = path => { try { accessSync(path) return true } catch (er) { return er.code !== 'ENOENT' } } const moveFile = async (source, destination, options = {}, root = true, symlinks = []) => { if (!source || !destination) { throw new TypeError('`source` and `destination` file required') } options = { overwrite: true, ...options, } if (!options.overwrite && await pathExists(destination)) { throw new Error(`The destination file exists: ${destination}`) } await mkdirp(dirname(destination)) try { await rename(source, destination) } catch (error) { if (error.code === 'EXDEV' || error.code === 'EPERM') { const sourceStat = await lstat(source) if (sourceStat.isDirectory()) { const files = await readdir(source) await Promise.all(files.map((file) => moveFile(join(source, file), join(destination, file), options, false, symlinks) )) } else if (sourceStat.isSymbolicLink()) { symlinks.push({ source, destination }) } else { await copyFile(source, destination) } } else { throw error } } if (root) { await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => { let target = await readlink(symSource) // junction symlinks in windows will be absolute paths, so we need to // make sure they point to the symlink destination if (isAbsolute(target)) { target = resolve(symDestination, relative(symSource, target)) } // try to determine what the actual file is so we can create the correct // type of symlink in windows let targetStat = 'file' try { targetStat = await stat(resolve(dirname(symSource), target)) if (targetStat.isDirectory()) { targetStat = 'junction' } } catch { // targetStat remains 'file' } await symlink( target, symDestination, targetStat ) })) await rimraf(source) } } const moveFileSync = (source, destination, options = {}, root = true, symlinks = []) => { if (!source || !destination) { throw new TypeError('`source` and `destination` file required') } options = { overwrite: true, ...options, } if (!options.overwrite && pathExistsSync(destination)) { throw new Error(`The destination file exists: ${destination}`) } mkdirp.sync(dirname(destination)) try { renameSync(source, destination) } catch (error) { if (error.code === 'EXDEV' || error.code === 'EPERM') { const sourceStat = lstatSync(source) if (sourceStat.isDirectory()) { const files = readdirSync(source) for (const file of files) { moveFileSync(join(source, file), join(destination, file), options, false, symlinks) } } else if (sourceStat.isSymbolicLink()) { symlinks.push({ source, destination }) } else { copyFileSync(source, destination) } } else { throw error } } if (root) { for (const { source: symSource, destination: symDestination } of symlinks) { let target = readlinkSync(symSource) // junction symlinks in windows will be absolute paths, so we need to // make sure they point to the symlink destination if (isAbsolute(target)) { target = resolve(symDestination, relative(symSource, target)) } // try to determine what the actual file is so we can create the correct // type of symlink in windows let targetStat = 'file' try { targetStat = statSync(resolve(dirname(symSource), target)) if (targetStat.isDirectory()) { targetStat = 'junction' } } catch { // targetStat remains 'file' } symlinkSync( target, symDestination, targetStat ) } rimrafSync(source) } } module.exports = moveFile module.exports.sync = moveFileSync
08-02[图片] 然后这又是什么问题?为什么同一个小程序会有两个声明文件?这非常奇怪,也报错了,虽然不影响程序执行,但要是不管这些我用typescript的意义何在啊?
Typescript 下 Component 组件对外属性的自定义类型问题,如何声明其他类型?我有一个公共的model包,这里面存了很多共用的类型,比如用户类型、地址类型等。我还是用了一个基类,这个基类有一些公用的方法,比如时间戳转秒,金额换算等,我让其它类集成这个基类。之后在小程序的组件中传递数据的过程中发现,数据传递到组建后完全变了一个类型,我没有办法使用基类的方法。这是个很头疼的问题啊,想优雅的写个代码都是问题了。小程序都发展这么久了不应该这样呀,组件类型是很重要的事情呢。
2023-07-22需要在后台配置业务域名。
web-view 打开网页提示不支持?打开地址:https://work.weixin.qq.com/gm/12c373378a1b4bbf11f0646e20c3e188 [图片]
2023-03-20清理一下浏览器的缓存
服务器域名为什么配置不了?[图片] 一直不显示二维码,该怎么配置域名
2023-03-20同求啊大佬 一模一样的场景
web-view 中cover-view点击事件无效[图片]
2022-10-11