I am a novice Japanese web developer.
Unfortunately, my English skills are not great.
I apologize for any inconvenience.
I am interested in utilizing this specific module:
https://www.npmjs.com/package/unzip
To do so, I executed the following commands: yarn add unzip
, yarn add fs
, yarn add module v8
, and
yarn add <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e99b8c989c8c9a9da9dbc7ded0c7d9">[email protected]</a>
.
Additionally, I included the following code snippet:
var fs = require('fs');
var unzip = require('unzip');
However, an error occurred due to "require('unzip')."
Uncaught Error: No such module. (Possibly not yet loaded)
During the build process, I encountered the following warning messages:
WARNING Compiled with 3 warnings 16:03:20
warning in ./node_modules/natives/index.js
Critical dependency: the request of a dependency is an expression
warning in ./node_modules/lazy-debug-legacy/src/functions.js
Critical dependency: the request of a dependency is an expression
warning in./node_modules/lazy-debug-legacy/src/functions.js
Critical dependency: the request of a dependency is an expression
Could someone provide guidance on resolving this issue? I am unable to utilize the unzip module successfully.
In addition, I attempted using another module:
https://www.npmjs.com/package/unzipper
When I added the following line of code:
var unzipper = require('unzipper');
A different error was triggered:
polyfills.js?a0a3:32 Uncaught TypeError: Cannot read property 'match' of undefined
Here is my full code snippet:
//converter.ts
var fs = require('fs');
var unzipper = require('unzipper');
export default function converter(file) {
console.log(file)
// fs.createReadStream(file)
// .pipe(unzipper.Extract({ path: './tmp/' }));
}
//convert.vue
<template>
<div class="convert">
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator";
import converter from "./converter"
@Component({
components: {}
})
export default class Convert extends Vue {
mounted(){
converter("./resources/text.zip")
}
}
</script>
<style lang="scss">
</style>