tab-tracker
tab-tracker copied to clipboard
Server start
I am getting this error
λ npm start
[email protected] start c:\www\Homestead\projects\sermonapp\server ./node_modules/nodemon/bin/nodemon.js src/app.js --exec 'npm run lint && node'
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: ./node_modules/nodemon/bin/nodemon.js src/app.js --exec 'npm run lint && node'
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\Danre Visser\AppData\Roaming\npm-cache_logs\2017-09-19T13_45_31_696Z-debug.log
I am running local on windows system.I guess its got something to do with windows
@JacquesvanWyk what node version do you use?
v8.5.0
That's great, looks like it's a problem with windows ./
path format
Can you modify the package.json after you done with npm install to:
"start":"nodemon src/app.js"
Thanks
if you want the lint to work you can do the same for the lint action "lint":"eslint src/**/*.js"
If anyone wants to submit a PR to make this work for all operating systems, feel free to do so =). Or, at the very least update the README for instructions with windows.
Just for future reference, if on windows, it is best to use the Windows Subsystem for Linux if on W10, since you can access your projects and execute commands in a bash shell, similar to how the commands are run in the tutorial. I've been doing this, and I haven't had any issues with the path formatting.
Here's how to install the WSL from MSDN!
for windows system: package_json located in the TAB-TRACKER/server/src/package.json
"scripts": { "start":"nodemon src/app.js", "lint":"eslint src/**/*.js" },
This error happens because some windows terminals misunderstand single quotes, So there's some parsing errors in node
You can easily detect it by errors like this
'npm is not recognized (...)
Showing a single quote before the command that is not recognized
In this case I used escaped double quotes instead of single ones in the scripts I used in package.json:
"scripts": {
"start": "nodemon src/app.js --exec \"npm run lint && node\"",
"lint": "eslint **/*.js"
}
And it works now. Hope this helps..
It's preferable to refer to your dev environment packages, not to global ones. Therefore, please see a chuck from a package.json (server):
"scripts": {
"start": "./node_modules/.bin/nodemon src/app.js --exec \"npm run lint && node\"",
"lint": "./node_modules/.bin/eslint \"**/*.js\"",
"test": "echo \"Error: no test specified\" && exit 1"
},