3,196 questions
1
vote
0
answers
18
views
Error: Cannot find module './src/handlers/buttons.js' after migrating all files to a ./src folder [duplicate]
I'm working on a Discord bot using the popular Discord.js library
I've recently moved all my non config files to a folder called 'src'
In my 'index.js' file I have an fs statement that reads all the ...
0
votes
1
answer
47
views
How to read directories and subdirectories (having 15000 subdirectories) using directory-tree npm in node js
We are using directory-tree npm to read all the directories and sub directories(subdirectories having 15000 multiple subdirectories)
Used Code:
const dirTree = require("directory-tree");
...
1
vote
0
answers
341
views
Node FS Access not throwing EACCESS error when testing against READ/WRITE in C:\Program FIles
The project I'm working on allows the user to choose where they want to locate the files we use and by default on Windows we set the main file in a folder in C:\Program Files.
Well when wanting to ...
-3
votes
1
answer
1k
views
Can't resolve "fs" imported from ... importing custom package in Next.js [duplicate]
I am working in a monorepo, using bolt to manage package installation. I also use preconstruct in order to build exports which are compatible with both module and common js.
With preconstruct I am ...
1
vote
0
answers
190
views
reading a big file in chunks and adding to object
I am trying to read a big file in chunks instead of loading it directly to memory using nodejs. My goal is to read the file but cannot load it into memory as the file is big and then group the ...
1
vote
1
answer
1k
views
NodejS fs with authentication on accessing shared directory from cloud
We're using node fs to access Files from NFS Network Drive. While testing locally, it works fine as it tries to access the NFS using my credentials in the background.
When I deploy the same code in ...
0
votes
1
answer
329
views
How come my async function is not working in Node JS? [duplicate]
I'm trying to make a REST api to hold json files for contacts, for some reason my endpoint responds before it should.
const fs = require("fs/promises");
app.get("/contacts", async ...
0
votes
1
answer
596
views
Can't resolve fs, child_process
I know there are many other questions reporting very similar situations, but not exactly, and none helped me.
I'm trying to use the 'ffmpeg-static-electron' dependency on Angular Electron.
On my yt-...
2
votes
1
answer
177
views
Issue with loading chunks into the client
I'm trying to create a readableStream through which I would send chunks of data ( html in this case ). The problem is that even if I manage to get a chunk of data the res.write() method does nothing ...
-1
votes
2
answers
62
views
Javascript for loop variable is strange when writing on a file
I have this code in './utils/url.js'. it basically makes the application/x-www-form-urlencoded content form:
const ContentForm = ()=>{
let params = new URLSearchParams()
const randomString =...
0
votes
1
answer
776
views
0xc00d36c4 while saving file to wav format nodejs amazon polly text to speech
I am using Amazon polly for text to speech.
Here is the code
static async _ttsUsingPolly(text, gender, destPath, speed) {
let params = {
'Text': 'Hi, my name is @anaptfox.',
'...
1
vote
1
answer
520
views
Attempting to upload a file from local to a server via php
I'm attempting to upload a file via node from my local system to a php based remote server.
My initial attempt:
const readStream = fs.createReadStream(filePath);
fetch(API_ENDPOINT, {
...
1
vote
1
answer
460
views
webpack5 polyfill for fs is stubbornly not resolving for an Angular 14 project
A fresh install of Angular 14 Ionic 6 project, installed the @aws-sdk/client-s3 (v3) package.
The @aws-sdk is relying on the fs module in some of its libraries, e.g.:
\node_modules@aws-sdk\shared-ini-...
0
votes
1
answer
118
views
Attempting to prepare a file with fs to upload to a server via php
I currently have a local file path
var localFile = "/Desktop/here/myfile.jpg";
const buffer = fs.readFileSync(localFile);
const fileName = 'thumb.jpg';
I then attempt to add this to a ...
0
votes
2
answers
634
views
Express - Cannot access 'Database' before initialization
const express = require('express');
const upload = require("express-fileupload");
const editJsonFile = require("edit-json-file");
const fs = require('fs');
const app = express();
...
1
vote
3
answers
2k
views
Unable to resolve module fs - react-native-dotenv
I am doing an online course about React-Native and Firebase but I came across an error.
Here it is : Error: Unable to resolve module fs from Documents/code/ChatApp/node_modules/react-native-dotenv/...
0
votes
1
answer
1k
views
fs.unlink not deleting file in local folder after updating item
I try to update posts but fs.unlink() doesen't remove the older files in my local folder. In my collection, the image path seem to be updated as the old path is replaced. I don't know why the old ...
0
votes
2
answers
598
views
Fanotify access permission event for all files in a directory
I want to get notify for each time a file is accessed in a certain directory using fanotify. I'm familiar with fanotify and generally know how to do it, my problem is with fanotify_mark function and ...
1
vote
2
answers
358
views
Nodejs not sending http requests inside File ReadStream
I'm having a very strange error where my http requests aren't sending at all. Once I send the request it just stops executing. I'm ingesting a CSV file through a ReadStream and sending requests inside ...
1
vote
0
answers
412
views
Node.JS rename file in mounted drive
I want to be able to rename files using Node.JS and then rename them back via a separate system and then rename them again via Node.JS.
When renaming a file using Node.JS fs.rename it works the first ...
0
votes
1
answer
321
views
fs.writeFileSync and then upload the file to Firebase Storage
I am able to create a 300 byte JavaScript file with fs.writeFileSync, and I can see the file contents with fs.readFileSync (in a console log at least) but I don't understand how to use this file any ...
0
votes
1
answer
563
views
Reading multipart pdf from http request on Node js backend
I am using Node.js to run a backend script that performs and http request using axios. The http request returns a pdf that I would like to save in my file system. However, when I tried to do this (...
0
votes
1
answer
336
views
unable to add json content to an existing json file using Node.js
I have a json prepared file with key-value pairs as arrays. I am writing a program to add new static json (in the same format) to the existing file using "fs" module. I am aware that we ...
0
votes
0
answers
279
views
Electron & Angular - get path of <input> file field
Is there a way to get the file path of the file that the user has uploaded?
I have this input field (Angular):
<div class="input-group mb-3">
<input #select type="file"...
2
votes
1
answer
3k
views
Node fs.readdirsync read directory in npm package
i tried to use fs.readdirSync and it work perfectly, but when i publish to npm and install this package to my new project, it not read my package directory instead it will read from my new project ...