First off, I am a complete noob to web development involving servers. I've searched tirelessly and done everything within my knowledge. I am way too curious to figure out how to run this node js app. Is it possible for anyone to give me a step by step instructions on how to get it running?
https://github.com/android-fanatic/video-timeline-comment-tagging-demo
I have mongodb and nodejs installed but I get this Darwin Error when I run
npm start
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "start"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! missing script: start
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/JonDoe/Documents/web_apps/video-timeline-comment-ta`
Any help will be greatly appreciated.
Inside the package.json file, the start script is not specified, so npm start wont work. Change your package.json to the following
{
"name":"real-video-fake-tags",
"version":"0.0.4",
"private":true,
"scripts": {
"start": "node app.js"
},
"dependencies":{
"express":"2.5.10",
"jade":">= 0.2.0",
"mongoose" :">= 2.7.0",
"mailer":">=0.6.7"
}
}
Related
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
Can someone help. I am completely new to this but when I am running the script I am getting below error. if someone can teach me or help me it would be a great help
functions# deploy /Users/kapilgaur/Downloads/React-Native-APP-master/functions
firebase deploy --only functions
sh: firebase: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! functions# deploy: `firebase deploy --only functions`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the functions# deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kapilgaur/.npm/_logs/2020-03-05T13_09_05_478Z-debug.log
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
run this in your terminal
alias firebase="`npm config get prefix`/bin/firebase"
or you just install firebase tool globally
npm install -g firebase-tools
either of them should do the trick,
When i try installing node js it gives me this errors
C:\Users\Administrator>cd C:/xampp/htdocs/chat
C:\xampp\htdocs\chat>npm install
npm WARN package.json chat#4.5.0 No repository field.
npm WARN package.json chat#4.5.0 No README data
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\ node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall getaddrinfo
npm ERR! enoent getaddrinfo ENOENT registry.npmjs.org:443
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\chat\npm-debug.log
My question is how can i prevent those errors and install node js and socket io correctly.
I suggest you install from NVM
after that. just do nvm install
to check. node -v inside your terminal
Install NodeJS from their website, then execute npm init within your project folder.
Afther that you can install dependencies from NPM.
Just read, what's on their websites under "getting started"...
I did npm init and this is my .json file
"name": "chat",
"version": "4.5.0",
"description": "IO",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Dan Vasii",
"license": "ISC",
"dependencies":
{
"socket.io" : "*",
"express" : "*"
}
}
Download the Windows installer from https://nodejs.org/en/ .
Run the installer (the .msi file you downloaded in the previous step.)
Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).
Here is the solution for the above error.
Go to (nodejs) and Download NodeJs.
Install the NodeJs where you want in your PC
Now try to execute the command npm install
The error will be resolved. Any help needed please refer to this link
I transferred a ReactJS + NodeJS project from another computer to a new computer. Then inside the folder, I did npm install in the terminal but getting the following response back.
> fsevents#1.0.14 install /Users/Joshua/Projects/practice_project/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
[fsevents] Success: "/Users/Joshua/Projects/practice_project/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
And on the previous computer, I ran the project via npm run server, but when I do it after npm run server in the project on the new computer, now I am getting:
> practice_project#1.0.0 serve /Users/Joshua/Projects/practice_project
> nodemon server/server.js --ignore components
sh: nodemon: command not found
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "serve"
npm ERR! node v4.6.1
npm ERR! npm v2.15.9
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! practice_project#1.0.0 serve: `nodemon server/server.js --ignore components`
npm ERR! spawn ENOENT
I looked around but can't seem to find the right solution. Tried npm install -g node-gyp but getting tar.unpack untar error.
What could be the issue? Will upvote and accept the answer. Thank you.
In this case, the first message you received is just telling you it's attempting to rebuild the fsevents package for your environment, then realized it already had it built, so stopped the process.
The second message is indicating that you are attempting to run nodemon but it isn't installed. I would hazard a guess that it was installed globally on your previous machine (and therefore not included in the project's package.json). If you want to install it globally again, you'll need to run npm i -g nodemon.
I have node.js installed on my machine, I have version: v0.12.0 installed. Following instructions when I use sudo npm install I get these errors:
npm ERR! install Couldn't read dependencies
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.6.0
npm ERR! path /Users/aston.haigh/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -2
npm ERR! package.json ENOENT, open '/Users/aston.haigh/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/aston.haigh/Projects/astonhaigh.co.uk/npm-debug.log
Ive tried clearing the node cache, updating node and havent had any luck, any ideas?
Seem to fix the issue when i uninstalled node and then reinstall using homebrew. P.s really good tutorial: https://www.youtube.com/watch?v=FqMIyTH9wSg