can't run my node js project on my cpanel - javascript

Run NPM Install
returncode: 126
stdout:
> zenitcouture#1.0.0 start /home/zenitcou/zenitcouture
> nodemon app.js
stderr:
npm WARN lifecycle The node binary used for scripts is /home/zenitcou/nodevenv/zenitcouture/10/bin/node but npm is using /opt/alt/alt-nodejs10/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
sh: /home/zenitcou/zenitcouture/node_modules/.bin/nodemon: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! zenitcouture#1.0.0 start: `nodemon app.js`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the zenitcouture#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! /home/zenitcou/.npm/_logs/2021-10-09T17_17_22_982Z-debug.log
the above is my code. I'm trying to upload it to my cpanel and run it but i keep getting this error. I've stopped the app, and restarted it, the same error.
An error occured during installation of modules. The operation was performed, but check availability of application has failed. Web application responds, but its return code "500 Internal Server Error" or content type before operation "text/html; charset=UTF-8" doesn't equal to contet type after operation "text/html; charset=UTF-8".
i also get this error above if i dont stop the app before installing npm

Related

When i run the npm run build for react project i am getting the error, please check below code

'REACT_APP_BUILD_ENV' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! argon-dashboard-pro-react#1.2.0 build: `react-csp dev && REACT_APP_BUILD_ENV='test' react-scripts build && gulp licenses`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the argon-dashboard-pro-react#1.2.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\Shubham Jayswal\AppData\Roaming\npm-cache\_logs\2022-03-22T13_44_53_411Z-debug.log
I am trying to build my code but when I run npm run build with react project getting every time error, stuck there don't have an idea how to resolve that error, could please give me solution how to fix that error.
I am using Windows.
if on windows
change build in package.json to
react-csp dev && set REACT_APP_BUILD_ENV='test' react-scripts build && gulp licenses

Node js deploy with C Panel

I'm trying to deploy my first project on a server with C Panel, I followed this guide but when I press "run JS script" I get the following error:
returncode: 126
stdout:
> node-mysql#1.0.0 start /home/manteia1/Area_SFTP
> nodemon app.js
stderr:
npm WARN lifecycle The node binary used for scripts is /home/manteia1/nodevenv/Area_SFTP/8/bin/node but npm is using /opt/alt/alt-nodejs8/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
sh: /home/manteia1/Area_SFTP/node_modules/.bin/nodemon: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! node-mysql#1.0.0 start: `nodemon app.js`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the node-mysql#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! /home/manteia1/.npm/_logs/2021-02-10T14_38_41_625Z-debug.log

Why won't node.js work for me across any of my applications? ELIFECYCLE error

Every application I run gets the same error message: ELIFECYCLE
Here is my error message:
> pwd#1.0.0 start /Users/test/Desktop/test
> server.js
sh: server.js: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! pwd#1.0.0 start: `server.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the pwd#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/test/.npm/_logs/2020-08-22T14_40_02_505Z-debug.log
Andrews-iMac:test test$
I threw up this super basic application to test whether it was happening across all of my projects. Clearly it is. Any ideas as to how to resolve?
In your package.json, I noticed your start script only has “server.js” in it. You might have to write
“start”: “node server.js”
As your start script in order for it to work
Your start script needs to indicate you want to run node, it's not implied, since technically you can run any command in there
"start": "node server.js"
Could you try editing your start script to be
node server.js
Or even just run this command on your terminal.
This is how you use node.js to create a runtime environment for your js file

Creating a new angular project with ng new

When I try to create a new Angular 4 project with 'ng new myProject', the project folder, sub folders and files are created,
but I also always get these errors:
npm ERR! path c:\projects\hello-world\node_modules\fsevents\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rmdir
npm ERR! Error: EPERM: operation not permitted, rmdir 'c:\projects\hello-world\node_modules\fsevents\node_modules'
npm ERR! { Error: EPERM: operation not permitted, rmdir 'c:\projects\hello-world\node_modules\fsevents\node_modules'
npm ERR! stack: 'Error: EPERM: operation not permitted, rmdir \'c:\\projects\\hello-world\\node_modules\\fsevents\\node_modules\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rmdir',
npm ERR! path: 'c:\\projects\\hello-world\\node_modules\\fsevents\\node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
I open the Node.js command prompt as Administrator when I issue the ng new command.
I am using Win7 Pro. I have install the following successfully and without any errors. The ng -v returns the following:
-Angular CLI: 1.5.0
-Node: 8.9.0
-OS: win32 x64
-Angular:
npm -v returns: 5.5.1
I give my user account, based on the 'whoami' results, full admin permissions to the myProject folder, the C:\Users\myAccount\AppData\Roaming\npm folder and %APPDATA%\npm-cache folder.
I also perform a 'npm cache verify'.
But I still get the above errors on the ng new command.
How do I correct these errors? Or can I ignore these errors?
If you still run into this problem, one reason you might be running into this is that you installed your CLI tools (#angular/cli) using either 'sudo npm install -g #angular/cli' or as root, from the 'sudo su - root' command, then simply 'npm install -g #angular/cli', and your problem seems to arise whenever you're not logged in and calling an 'ng' command as root or with 'sudo'. This makes sense, but it always causes some kind of insufficient permission related error; and it's not even your fault.
You can easily try to fix or mitigate this serious error by creating and saving a dot-file named '.npm-global' in your home directory ('~/'), then running the command, npm config set prefix '~/.npm-global'.
Then, simply include the line in either /etc/profile or ~/.profile, export PATH=~/.npm-global/bin:$PATH, and run 'source /etc/profile' or 'source ~/.profile' to finalize it. [1]
After that, simply remove anything Node, like 'node_modules/', 'package-lock.json', just all of it.... Then, try installing your NPM packages again -- this time, without using 'sudo' and without root signed in.
https://docs.npmjs.com/getting-started/fixing-npm-permissions

How can i change vue-tweet-embed npm packages, test and use it in my project?

How can i change vue-tweet-embed npm package, test and use it in my project.
i have tried to change it but not able to run or check (as describe in readme file).
i want to make changes for tweet that is not available or deleted then it should handle with some error message or image.
i am getting error like this:
'BABEL_ENV' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Test failed. See above for more details.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-tweet-embed#1.1.1 prepublish: `npm test && npm run clean && npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-tweet-embed#1.1.1 prepublish 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\IO\AppData\Roaming\npm-cache\_logs\2017-06-29T09_33_32_460Z-debug.log

Categories

Resources