I want to deploy strapi to a server managed with plesk.
I installed strapi in cli. Strapi itself also runs there but says that i should visit localhost:1337/admin
In Plesk a startup-file is needed. Strapi suggests a server.js with 2 lines of code in it
const strapi = require('strapi');
strapi(/* {...} */).start();
however, i exactly this. When i hit the NPM install button it also resolves everything without any problem. If i want to reach my site i get a error from Phusion Passenger
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'strapi'
Require stack:
- /var/www/vhosts/frosty-goldstine.82-165-106-228.plesk.page/strapi/server.js
- /usr/share/passenger/helper-scripts/node-loader.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 Module.require (/usr/share/passenger/helper-scripts/node-loader.js:80:25)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/var/www/vhosts/frosty-goldstine.82-165-106-228.plesk.page/strapi/server.js:1:16)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/var/www/vhosts/frosty-goldstine.82-165-106-228.plesk.page/strapi/server.js',
'/usr/share/passenger/helper-scripts/node-loader.js'
]
}
How is it possible, that strapi is unknown? And how can i resolve?
Just need to call the good node_module #strapi/strapi instead of strapi
Ubuntu 20.04.4 LTS
Plesk Obsidian
Strapi 4.1.9
npm 6.14.17
node 14.19.3
const strapi = require('#strapi/strapi');
strapi().start();
Make sure you run npm install before trying to start the application.
I don't remember how to do this from the admin interface, but you can SSH into the server and run <path-to-npm>/npm install
Related
So I recently started learning React Native by following a Udemy course. Until now, everything has worked just fine, but a couple of days ago I got this error message when running the simple "npm start" command. I've tried a few solutions like reinstalling the node_modules folder, updating everything to the latest version, but that did not help. Has anybody got the solution for this?
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'xdl'
Require stack:
- C:\Users\Korisnik\AppData\Roaming\npm\node_modules\expo-cli\build\exp.js
- C:\Users\Korisnik\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.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 _xdl (C:\Users\Kori
snik\AppData\Roaming\npm\node_modules\expo-cli\build\exp.js:152:16)
at Object.<anonymous> (C:\Users\Korisnik\AppData\Roaming\npm\node_modules\expo-cli\build\exp.js:282:1)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Korisnik\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\build\\exp.js',
'C:\\Users\\Korisnik\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\bin\\expo.js'
]
}
Thanks in advance!
download the Git Bash and install it , once it's installed open as administrator and write the code
npm install -g expo-cli --force
i dont have errors when i install but when i require quick.db in my main.js (its a discord.js bot in v12)
const db = require('quick.db')
i have an better_sqlite3.node error in my terminal
-C:\Users\Fatsah\Desktop\Wizzy Bot\node_modules\bindings\bindings.js:121
throw e;
^
Error: The module '\\?\C:\Users\Fatsah\Desktop\Wizzy Bot\node_modules\better-sqlite3\build\Release\better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
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:94:18)
at bindings (C:\Users\Fatsah\Desktop\Wizzy Bot\node_modules\bindings\bindings.js:112:48)
at Object.<anonymous> (C:\Users\Fatsah\Desktop\Wizzy Bot\node_modules\better-sqlite3\lib\database.js:9:24)
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) {
code: 'ERR_DLOPEN_FAILED'
}
PS C:\Users\Fatsah\Desktop\Wizzy Bot>
i tried to reinstall and update node.js into the last test
Node version : v16.7.0
Discord.js : v12.5.3
Npm Version : 7.20.3
I have this error not long ago, when I was using node v14 and I have the same with canvas / canvacord but is canvas.node
Reinstall all your dependencies, you probably upgraded Node after you installed better-sqlite3 and you need to rebuild the library again.
I followed a tutorial to create a CRUD App with Nodejs, I finished the project and everything worked fine. After I tried to move all the files and folders to a new folderand I destroyed everything.
Now when I try to run node app.js the following happen:
enter code herinternal/modules/cjs/loader.js:797
throw err;
^
Error: Cannot find module 'mime-types/node_modules/mime-db'
Require stack:
- C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\node_modules\mime-types\index.js
- C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\node_modules\accepts\index.js
- C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\node_modules\express\lib\request.js
- C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\node_modules\express\lib\express.js
- C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\node_modules\express\index.js
- C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\node_modules\mime-types\index.js:15:10)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Costis\\Documents\\Code\\Vue\\Mongodb_app\\server\\node_modules\\mime-types\\index.js',
'C:\\Users\\Costis\\Documents\\Code\\Vue\\Mongodb_app\\server\\node_modules\\accepts\\index.js',
'C:\\Users\\Costis\\Documents\\Code\\Vue\\Mongodb_app\\server\\node_modules\\express\\lib\\request.js',
'C:\\Users\\Costis\\Documents\\Code\\Vue\\Mongodb_app\\server\\node_modules\\express\\lib\\express.js',
'C:\\Users\\Costis\\Documents\\Code\\Vue\\Mongodb_app\\server\\node_modules\\express\\index.js',
'C:\\Users\\Costis\\Documents\\Code\\Vue\\Mongodb_app\\server\\app.js'
]e
Any suggestion?
You probably have to make a clean install your dependencies again with npm install, as you might have broken some symlinks (just assuming as I'm not a Windows user).
You can manually delete your node_modules folder and run npm install, or if you have an existing package-lock.json, use npm ci to install exactly the same versions of deps you had before.
I am trying to create my first sails app and I've followed the steps on the sails getting started (http://sailsjs.org/get-started). But when i try to do a sails lift, i get the following error:
(node:11291) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
module.js:442
throw err;
^
Error: Cannot find module 'express/node_modules/cookie'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/master/Desktop/Developer/NodeJS/HelloSails/node_modules/sails/lib/hooks/session/index.js:9:12)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at /Users/master/Desktop/Developer/NodeJS/HelloSails/node_modules/sails/lib/app/configuration/index.js:54:28
at Function.reduce (/Users/master/Desktop/Developer/NodeJS/HelloSails/node_modules/sails/node_modules/lodash/dist/lodash.js:3735:25)
at Configuration.defaultConfig (/Users/master/Desktop/Developer/NodeJS/HelloSails/node_modules/sails/lib/app/configuration/index.js:53:18)
at Configuration.bound [as defaults] (/Users/master/Desktop/Developer/NodeJS/HelloSails/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21)
I tried manually removing the 'node_modules' folder, inserting express as a dependency in my package.json and running 'npm install', but that did not work.
Im running Node v6.2.2 Sail v0.10.5 and NPM v3.10.6
What am i missing here?
update sails version to latest, it is issue of npm structure, old version use tree level dependency while new version use same level structure
sails upgrade version
It's a dependency issue with npm, this worked for me when I had the issue.
npm -g install npm#latest
I am trying to connect to redis in linux using node js as below
var redis = require('redis');
But, getting the error as below.
I have redis-2.4.17 installed in linux and the path is /home/masadmin/redis-2.4.17/src
Kindly help on how to connect to redis using node in linux.
module.js:340
throw err;
^
Error: Cannot find module 'redis'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/home/masadmin/Vinod/prapprRedisLoad.js:2:13)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
Have you installed the Node.js Redis module for your application? npm install redis (in the same directory as your application) will install it. Check out this screencast for more information.
I have the same error after Node.js Redis module has been installed.
I've fixed it (error) after changing NODE_PATH environment variable:
export NODE_PATH=$NODE_PATH:<YOUR_NODE.JS_HOME>/node_modules