Quantcast
Channel: Active questions tagged require - Stack Overflow
Browsing all 141 articles
Browse latest View live

require() error on node.js hosted with Plesk

I'm using Plesk to host a node.js app. In local theres is no problem, but when I upload the files, node cannot find one of my files.I have the next in my app.jsconst express = require('express');const...

View Article


PDFMAKE: 'Roboto-Regular.ttf' not found in virtual file system ONLY AFTER GULP

I created a simple app using knockout/bootstrap/gulp that downloads a pdf using pdfMake.js. It works fine in debug mode using VS2017. After publishing and using gulp it gives this error when run: File...

View Article


PHP Customization using child class pattern

I am creating a system which manages projects. Each projects' behaviour can be customized by custom PHP class called c11n, that the project's owner can create by extending my parent c11nBase class. It...

View Article

require is not defined in ES module scope, you can use import instead

I got this errer messages when using require:const ideasRouter = require('./routes/ideas'); ^ ReferenceError: require is not defined in ES module scope, you can use import insteadI want to import...

View Article

Uncaught Error: Dynamic require of "child_process" is not supported

I am trying to create a 'container' application that either downloads other apps if they don't exist or opens their .exe files if they do exist when the user clicks on their button in the 'container'...

View Article


in VS code can I see the value of a variable that is included from another file?

I'm doing a bit of cypress automated testing but this question is probably more flat out js or vscode.I have an object in a file that I export like thisconst ui = { profile:{ details:{ firstName:...

View Article

import equivalent for require in app.use()

I have the following code in my server.js file:import express from "express";import fs from "fs";const app = express();fs.readdirSync("./routes").map((r) => app.use("/api",...

View Article

'oracledb' Oracle Client Library errors ( Error: NJS-045 and other errors)

I have installed the oracledb library to my project folder by using the command'npm i oracledb --s'it has successfully installed, and it is in the folder 'node_modules' inside my project. Inside the...

View Article


How do I use dotenv with import in javascript

I want to use dotenv via node.jsI already tried with "require" but the browser does not support it. On the documentation it is advised to use import with ES6, which I did but there are still errors...

View Article


How to create a NPM package installed globally to run code from terminal with...

I created a javascript with node to rewrite javascricp file to make all require to import and my code do it perfectly. My NPM package is named require2import.it's here on Github.If run my script from...

View Article

Unresolved requirement: Require-Bundle: org.eclipse.ui

I have an RCP application in eclipse. That works into eclipse, but when I export it, I have this stacktrace!MESSAGE FrameworkEvent ERROR!STACK 0org.osgi.framework.BundleException: Could not resolve...

View Article

Route.get requires a callback function but got a object Undefined [closed]

In Terminal:\node_modules\express\lib\router\route.js:216throw new Error(msg);^Error: Route.get() requires a callback function but got a [object Undefined]My Code/FilesMain (./server/index.js)const...

View Article

How to use "require" in a modern Javascript? Standard approaches not working

I have a react, vite project that is in typescript and of "type: module", however, I need to call a one-of-a-kind file that is built with "require" syntax rather than "import". I can't update it so I...

View Article


NodeJS required module not available in other modules

I'm a bit new to NodeJS. Maybe it's just the way it works but to be sure:My 'index.js':var fs = require('fs');// do something with fs herevar app = require('./app.js');The...

View Article

Image may be NSFW.
Clik here to view.

webpack [Uncaught ReferenceError: require is not defined]

I recently started learning webpack and ran into the following problem. I have a configuration file webpack.config.jsconst path = require("path");module.exports = { mode: "development", entry:...

View Article


PHP - Failed to open stream : No such file or directory

In PHP scripts, whether calling include(), require(), fopen(), or their derivatives such as include_once, require_once, or even, move_uploaded_file(), one often runs into an error or warning: Failed to...

View Article

is there a require for json in node.js

I would like to include a couple of JSON files in my JavaScript code that are in the same directory as my JavaScript source file.If I wanted to include another JavaScript file I could simply use...

View Article


require() empty string id error on non-empty strings

When I try to run my js code there appears to be an error that shouldn't exist no matter what.Basically i loop through an array of strings (paths), i try to import an object (using require) using each...

View Article

Use Javascript libraries in typescript?

I'm quite new to typescript, so I´m sorry if the question is pretty easy. I want to use JS libraries in a .ts file. Also, I´m using node.js to run my program in my console.In JavaScript I used the...

View Article

Could not find a declaration file for module 'jsonwebtoken'. -pathname-...

So i was working on a backend project, using node and express,I need to use the json web token, after npm i jsonwebtoken i get in my node_modules.But the problem is this when i require that module in...

View Article
Browsing all 141 articles
Browse latest View live