how to develop project nextjs in cpanel ? error this below - reactjs

returncode: 1
stdout:
> my-app#0.1.0 start2 /home/ikanet/ali
> set NODE_ENV=production && node app
stderr:
npm WARN lifecycle The node binary used for scripts is /home/ikanet/nodevenv/ali/14/bin/node but npm is using /opt/alt/alt-nodejs14/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module '/home/ikanet/ali/app'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app#0.1.0 start2: `set NODE_ENV=production && node app`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app#0.1.0 start2 script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ikanet/.npm/_logs/2023-01-15T12_05_18_250Z-debug.log
i build my next project and config server.js. then upload all my files without node-modules in my server
run nodejs setup , and i faced this error.
my server : nodejs version 14

Related

Npm run build on my react app project doesn't work

When i start my react project all seems good, but when i try to build this, it doesn't work, i have this error :
node:internal/fs/utils:344
throw err;
^
Error: UNKNOWN: unknown error, lstat 'C:\Users\darkx\Bureau\mlvojobs\mlvojobs\node_modules\fs-extra\lib\util'
at Object.realpathSync (node:fs:2490:7)
at toRealPath (node:internal/modules/cjs/loader:394:13)
at tryFile (node:internal/modules/cjs/loader:390:10)
at tryExtensions (node:internal/modules/cjs/loader:402:22)
at Function.Module._findPath (node:internal/modules/cjs/loader:558:20)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
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\darkx\Bureau\mlvojobs\mlvojobs\node_modules\fs-extra\lib\copy\copy.js:7:22) {
errno: -4094,
syscall: 'lstat',
code: 'UNKNOWN',
path: 'C:\\Users\\darkx\\Bureau\\mlvojobs\\mlvojobs\\node_modules\\fs-extra\\lib\\util'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mlvojobs#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mlvojobs#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\darkx\AppData\Roaming\npm-cache\_logs\2022-08-18T22_53_48_493Z-debug.log
PS C:\Users\darkx\Bureau\mlvojobs\mlvojobs> npm install fs-extra
npm ERR! cb.apply is not a function
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\darkx\AppData\Roaming\npm-cache\_logs\2022-08-18T22_54_15_541Z-debug.log
And when i try to install something with npm it says :
npm ERR! cb.apply is not a function
Node.js sometimes works weird. I encountered this error, my option is switch to another Node.js version.
I recommend using nvm-windows (seem like you're using Windows)
You can install latest Node.js version lts
nvm install lts
Or specific version, for example:
nvm install 16.16.0
Then delete your project node_modules and run:
npm install
Finally, build your project again. Let me know if it work!
Possible solution :
Go to : C:\Users(your username)\AppData\Roaming
Delete the npm folder and if there is one npm cache folder.
Run npm cache clean —force
it should work

npm run build & npm start not working, react app

I am a new react student, have no place else to ask this question and can't solve it on my own because I'm really confused, I don't even know how to put this question together properly. I'm following the instructions from a react course.
I installed node.js, created a new project folder, then in the terminal I wrote create react-app . everything worked, and then wrote npm run build and npm start, but both didn't work.
Heres the error messages for npm run build:
> github-finder#0.1.0 build C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder
> react-scripts build
"Courses\github-finder\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\liana\Documents\My stuff\Webdev\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-finder#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-finder#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\liana\AppData\Roaming\npm-cache\_logs\2020-10-18T02_07_40_371Z-debug.log
PS C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder> npm run build
> github-finder#0.1.0 build C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder
> react-scripts build
"Courses\github-finder\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\liana\Documents\My stuff\Webdev\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-finder#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-finder#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\liana\AppData\Roaming\npm-cache\_logs\2020-10-18T02_10_32_763Z-debug.log
PS C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder>
And heres the code for npm start
> github-finder#0.1.0 start C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder
> react-scripts start
"Courses\github-finder\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\liana\Documents\My stuff\Webdev\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-finder#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-finder#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\liana\AppData\Roaming\npm-cache\_logs\2020-10-18T02_11_45_759Z-debug.log
PS C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder>
some messages are in russian, if you need translation use the translator or ask me to leave the translation here, whatever you prefer
Thank you for reading this, I'm desperate and need help, nothing on the internet helped me just yet
I found something that works.
Using the command node node node_modules/react-scripts/scripts/start.js does the same thing as npm start, though I don't know what's the catch here. Works for me. Source: https://github.com/facebook/create-react-app/issues/8221
Firstly to create your project based on "create-react...."
You have to use the exactly command "npx create-react-app 'yournameProject'"
Then open your folder in a text editor like visual code and run the following command -> "npm start"
It shouldnt give you error
About your problem: I think you have stepped something
So try to use first "npm i" then "npm start"

npm ERR This is probably not a problem with npm. There is likely additional logging output above

It happens when I try to start server. This is probably not a problem with npm. There is likely additional logging output above.
I got everything updated and still same.
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module '/Users/Mateusz/Documents/reactWebsite/node_modules/webpack-dev-server/bin/webpack-dev-server.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! redux-simple-starter#1.0.0 start: `node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the redux-simple-starter#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Mateusz/.npm/_logs/2020-02-20T09_12_14_220Z-debug.log`enter code here`
I don't know the why this error occurs, but I once got this error and solved through the following steps:
Delete node_modules and package-lock.json
Run npm install
Start the server again

Error with node.js deployment on Linux Azure web app

I habe an azur app service (Linux), connected to a bitbucket git repository running.
When I try to deploy it, I get this error:
> lhfrontend#1.0.0 postinstall /home/site/wwwroot
> npm run webdriver:update
npm WARN invalid config loglevel="notice"
> lhfrontend#1.0.0 webdriver:update /home/site/wwwroot
> node ./node_modules/protractor/bin/webdriver-manager update
module.js:471
throw err;
^
Error: Cannot find module '/home/site/wwwroot/node_modules/protractor/bin/webdriver-manager'
An error has occurred during web site deployment.
at Function.Module._resolveFilename (module.js:469:15)
npm failed
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3
npm ERR! Linux 4.4.0-108-generic
npm ERR! argv "/opt/nodejs/6.11.0/bin/node" "/usr/bin/node_modules/npm/bin/npm-cli.js" "run" "webdriver:update"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! lhfrontend#1.0.0 webdriver:update: `node ./node_modules/protractor/bin/webdriver-manager update`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lhfrontend#1.0.0 webdriver:update script 'node ./node_modules/protractor/bin/webdriver-manager update'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the lhfrontend package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./node_modules/protractor/bin/webdriver-manager update
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs lhfrontend
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls lhfrontend
npm ERR! There is likely additional logging output above.
Does any one have an idea, how to fix this?
Thanks in advance,
Dennis
Check if you have installed protractor module. If not, run this command in your app's root:
npm install protractor
Or add this to the dependencies section of your package.json:
"dependencies": {
"protractor": "^5.2.2"
}

yo angular error after package.json

I am trying to install angular on my windows 10. I followed every step in the yo tutorial, but once I get to package.json everything fails and shows errors. can anyone help me figuring out how to solve this. I have tried for almost a week searching online and nothing has worked. Error shown bellow:
*? Overwrite package.json? overwrite
force package.json
identical .travis.yml
bower ENOGIT git is not installed or not in the PATH
> phantomjs#1.9.17 install C:\Users\carli\node_modules\phantomjs
> node install.js
grunt-cli: The grunt command line interface. (v0.1.13)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
> phantomjs#1.9.17 install C:\Users\carli\node_modules\phantomjs
> node install.js
module.js:338
throw err;
^
Error: Cannot find module 'C:\Users\carli\node_modules\phantomjs\install.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Function.Module.runMain (module.js:475:10)
at startup (node.js:117:18)
at node.js:951:3
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\carli\\AppDat
Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.0.0
npm ERR! npm v2.14.3
npm ERR! code ELIFECYCLE
npm ERR! phantomjs#1.9.17 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs#1.9.17 install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\carli\npm-debug.log
module.js:338
throw err;
^
Error: Cannot find module 'C:\Users\carli\node_modules\phantomjs\install.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Function.Module.runMain (module.js:475:10)
at startup (node.js:117:18)
at node.js:951:3
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\carli\\AppDat
Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.0.0
npm ERR! npm v2.14.3
npm ERR! code ELIFECYCLE
npm ERR! phantomjs#1.9.17 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs#1.9.17 install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\carli\npm-debug.log*
I am trying to learn about Angularjs and this is one of the steps that is holding me back

Resources