command not found on my program while running it - node.js

how can i solve this [I just started learning nodejs and express. I currently use Linux Manjaro and I downloaded the required things from its store, but when I want to run something npm start or node server.js an error will occur and tells me command not found!.1?

Related

PM2 starting Meteor App not working

I have in one Digital Ocean Linux Ubuntu 16.041 droplet an instance of a Meteor app. Moreover, I installed Node.js version of 4.4.0
I created the respective bundle on the path ~/MyApplication/bundle. As a matter of fact, I automated with a config.json file the execution which its body contains the following code:
My main.js file is created from the Meteor build --directory ~/myDirectory/ command and contains the following code:
process.argv.splice(2, 0, 'program.json');
process.chdir(require('path').join(__dirname, 'programs', 'server'));
require('./programs/server/boot.js');
That being said, I run my application with pm2 through the config JSON file with pm2 start config.json
It starts the application, but several ms afterwards it is errored. The log error show the following exception regarding the typo, but seems the mainjs file is created fine. Any suggestions to solve it?
In the end, I had to update the node version in the server from 4.4.0 to 8.9.1. After doing that changes, I also had to install the dependencies within the bundle/programs/server/ using npm install

Cannot find module 'assetmanager'

I'm trying to run the MEAN stack on windows. I've installed all the pre-requisites (I think) but when I try to start the server via the gulp command I get the error:
Error: Cannot find module 'assetmanager'.
IMAGE:
I have tried running npm install assetmanager which run fine but I still get this error.
This is my first time trying to run node on a machine (I should have used a linux box) so go easy on me as I am learning :-).
Any and all help appreciated.
David
I had exactly the same problem on Linux Mint 17.2.
The failing way: This was my first project that I'd generated and I don't think I had all the dependencies installed before I ran the init command (g++ was missing).
I tried the npm install assetmanager command as you did and then install worked. Running gulp after this, it got further but this time I was missing mongoose. I installed that then it couldn't find .../config/env/all so I sylinked the default.js config. Then running gulp again, errorhandler was missing. I figured it shouldn't be this hard so...
The working way: I deleted that failure of a project and init'd a new one and it worked. Unfortunately I'm not sure if the init didn't work the first time but I missed the error/warning or something else caused it. All I can recommend is try creating another project and see if that works.

node.js server.js module'simple debug' error

I am fairly new at node.js, I am using the most recent node.js available .12 on windows 8.1 OS. I am tring to run a program that controls some robotics using a gesture control device, but whenever I run the node server.js I receive the following:
module.js:338
throw error
module cannot be found 'simple debug'
I ran npm install simple debug to see if the modules didn't install correctly with original node.js. There are two modules simple and debug and they are installed. I tried the faye install and express solutions and got nothing.
Does anyone have any ideas how to solve this?
Assuming you're using this module, you should consider adding the hyphen for simple-debug instead of simple debug.

NodeJS just crashes without any information

I am trying to deploy a meteor (nodeJS) app on a Virtual Server.
My Problem:
I cannot start forever - I thought. Then I tried to start the app as described in the manual: node main.js just error code -1.
Then I tried to check wich Node version is installed node -v and I also get a return value of -1 and no more error message.
Does anyone have an idea?
A reinstallation of the nodejs packet (jap, the "node" packet is something different in ubuntu) helped

Issue with Node-based Cordova Hook

I'm playing around with the Cordova hooks capabilities and I'm trying to test using a node application as a hook. In this article: http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/ it references running node applications, so I know it's possible.
I've created a simple node application that I'm using to test the before prepare and after prepare process:
#! /usr/bin/env node
console.log("this is a node module");
When I run my prepare, I get the following error:
C:\Users\jwargo\dev\lunchmenu>cordova prepare
The system cannot find the path specified.
Hook failed with error code 1: C:\Users\jwargo\dev\lunchmenu\hooks\before_prepare\test.js
I can't find any information anywhere about what an error code of 1 means here.
I've tested the node code and it runs fine with "node test.js" and when I execute test.js from the command line Windows simply launches my default editor.
So, can anyone tell me what I'm doing wrong or what I need to do to be able to execute a node application as a hook with the Cordova CLI?
Figured it out with some help from the Cordova dev team. The space in my shebang was causing the problem. I removed it and the problem went away.

Resources