I'm trying to run a custom module in node.js, but for some reason it spits out this error:
Require stack:
- C:\Users\Administrator\Desktop\Sitev\Site\general.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15
)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Administrator\Desktop\Sitev\Site\general.js:7:1)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_ma
in:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Administrator\\Desktop\\Sitev\\Site\\genera
l.js'
]
}
Node.js v17.1.0
Thing is the thing im trying to require is right there
I tried everything, Here is combinations of require that i tried
require(".\page_serve")
require(".\page_serve.js")
require("./page_serve")
require("./page_serve.js")
require("page_serve")
require("page_serve.js")
I tried all of them but still the same error
Operating system is windows server 2012
I forgot the variable itself.
Correct one should be:
let page_serve = require("./page_serve")
Related
Getting an error when running npm run build:ssr to try to deploy my angular application
The error:
firestarter#0.0.0 compile:server
webpack --config webpack.server.config.js --progress --colors
C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\webpack-cli\bin\cli.js:93
throw err;
^
TypeError: Cannot read properties of undefined (reading 'create')
at Object. (C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\webpack.server.config.js:5:39)
at Module._compile (C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at WEBPACK_OPTIONS (C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\webpack-cli\bin\utils\convert-argv.js:114:13)
at requireConfig (C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\webpack-cli\bin\utils\convert-argv.js:116:6)
at C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
at Array.forEach ()
at module.exports (C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\webpack-cli\bin\utils\convert-argv.js:121:15)
at C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\webpack-cli\bin\cli.js:71:45
at Object.parse (C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\webpack-cli\node_modules\yargs\yargs.js:576:18)
at C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\webpack-cli\bin\cli.js:49:8
at Object. (C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\webpack-cli\bin\cli.js:366:3)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at runCli (C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\webpack\bin\webpack.js:54:2)
at Object. (C:\Users\2998542\Documents\DeveloperPortfolio\Projects\firestarter\node_modules\webpack\bin\webpack.js:147:2)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
See the code below that the error is pointing to.
I've been trying to figure out why is giving me that error for weeks now.
const webpack = require('webpack');
const WebpackConfigFactory = require('#nestjs/ng-universal')
.WebpackConfigFactory;
module.exports = WebpackConfigFactory.create(webpack, {
// Nest server for SSR
server: './server/main.ts'
});
WebpackConfigFactory no longer exists as Angular is now using CLI Builders to build & serve SSR apps.
Issue reported here
I am trying to use the command "slsart deploy" but it's not working for me. How do I troubleshoot the error below?
slsart deploy
/usr/local/lib/node_modules/serverless/node_modules/type/lib/resolve-exception.js:14
throw error;
^
TypeError: undefined is not an array
at module.exports (/usr/local/lib/node_modules/serverless/node_modules/type/lib/resolve-exception.js:12:14)
at module.exports (/usr/local/lib/node_modules/serverless/node_modules/type/array/ensure.js:15:25)
at new Serverless (/usr/local/lib/node_modules/serverless/lib/serverless.js:86:22)
at Object.serverlessLoader (/usr/local/lib/node_modules/serverless-artillery/lib/index.js:542:24)
at Object.deploy (/usr/local/lib/node_modules/serverless-artillery/lib/index.js:563:27)
at Object.<anonymous> (/usr/local/lib/node_modules/serverless-artillery/bin/serverless-artillery:205:16)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
I got this error while running the above command (npx react-native init MainApp)
I have installed the latest version of node and npm. I am not sure why this error is reflected.
Tried clearing the cache changing the node version to 17 but no luck. I am new to this react native.
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module './error'
Require stack:
- C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#hapi\hoek\lib\assert.js
- C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#hapi\topo\lib\index.js
- C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\node_modules\joi\lib\types\keys.js
- C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\node_modules\joi\lib\types\function.js
- C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\node_modules\joi\lib\index.js
- C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\build\tools\config\schema.js
- C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\build\tools\config\readConfigFromDisk.js
- C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\build\tools\config\index.js
- C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\build\commands\install\install.js
- C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\build\commands\index.js
- C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\build\index.js
- C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\build\bin.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\priye\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#hapi\hoek\lib\assert.js:3:21)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\priye\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#hapi\\hoek\\lib\\assert.js',
'C:\\Users\\priye\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#hapi\\topo\\lib\\index.js',
'C:\\Users\\priye\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\node_modules\\joi\\lib\\types\\keys.js',
'C:\\Users\\priye\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\node_modules\\joi\\lib\\types\\function.js',
'C:\\Users\\priye\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\node_modules\\joi\\lib\\index.js',
'C:\\Users\\priye\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\build\\tools\\config\\schema.js',
'C:\\Users\\priye\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\build\\tools\\config\\readConfigFromDisk.js',
'C:\\Users\\priye\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\build\\tools\\config\\index.js',
'C:\\Users\\priye\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\build\\commands\\install\\install.js',
'C:\\Users\\priye\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\build\\commands\\index.js',
'C:\\Users\\priye\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\build\\index.js',
'C:\\Users\\priye\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\build\\bin.js'
]
}
Hi I myself resolved the issue. I deleted the npm-cache folder from the AppData folder and it worked :). Thanks
The bot worked perfectly until one day (without touching anything) it stopped working and I got this error in the node_modules folder:
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module '../build/Release/canvas.node'
Require stack:
- /home/container/node_modules/canvas/lib/bindings.js
- /home/container/node_modules/canvas/lib/canvas.js
- /home/container/node_modules/canvas/index.js
- /home/container/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:903:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/container/node_modules/canvas/lib/bindings.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:903:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/container/node_modules/canvas/lib/bindings.js',
'/home/container/node_modules/canvas/lib/canvas.js',
'/home/container/node_modules/canvas/index.js',
'/home/container/index.js'
]
}
Primordals error keeps going off each time I try to start https://github.com/discordboats-club/website/ on my vps so it starts then stops here is the full error enter image description here
Creating a pool connected to localhost:28015
fs.js:27
const { Math, Object } = primordials;
^
ReferenceError: primordials is not defined
at fs.js:27:26
at req_ (/root/node_modules/natives/index.js:143:24)
at Object.req [as require] (/root/node_modules/natives/index.js:55:10)
at Object.<anonymous> (/root/node_modules/webshot/node_modules/graceful-fs/f s.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:955:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
at Module.load (internal/modules/cjs/loader.js:811:32)
at Function.Module._load (internal/modules/cjs/loader.js:723:14)
at Module.require (internal/modules/cjs/loader.js:848:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/root/node_modules/webshot/node_modules/graceful-fs/g raceful-fs.js:3:27)
at Module._compile (internal/modules/cjs/loader.js:955:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
at Module.load (internal/modules/cjs/loader.js:811:32)
at Function.Module._load (internal/modules/cjs/loader.js:723:14)
at Module.require (internal/modules/cjs/loader.js:848:19)
Please tell me how to fix this