tab-tracker icon indicating copy to clipboard operation
tab-tracker copied to clipboard

Server start

Open JacquesvanWyk opened this issue 7 years ago • 10 comments

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 avatar Sep 19 '17 13:09 JacquesvanWyk

@JacquesvanWyk what node version do you use?

Alaev avatar Sep 19 '17 17:09 Alaev

v8.5.0

JacquesvanWyk avatar Sep 19 '17 18:09 JacquesvanWyk

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"

Alaev avatar Sep 19 '17 18:09 Alaev

Thanks

JacquesvanWyk avatar Sep 19 '17 18:09 JacquesvanWyk

if you want the lint to work you can do the same for the lint action "lint":"eslint src/**/*.js"

Alaev avatar Sep 19 '17 18:09 Alaev

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.

codyseibert avatar Sep 20 '17 16:09 codyseibert

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!

MEXdave1997 avatar Sep 20 '17 18:09 MEXdave1997

for windows system: package_json located in the TAB-TRACKER/server/src/package.json

"scripts": { "start":"nodemon src/app.js", "lint":"eslint src/**/*.js" },

kshimauchi avatar Mar 27 '18 07:03 kshimauchi

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..

rebosante avatar Jun 22 '18 14:06 rebosante

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" },

s-gryt avatar Sep 24 '18 16:09 s-gryt