Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to run lite-server #9

Closed
pierpy opened this issue Dec 30, 2015 · 20 comments
Closed

Trying to run lite-server #9

pierpy opened this issue Dec 30, 2015 · 20 comments

Comments

@pierpy
Copy link

pierpy commented Dec 30, 2015

I'm a node.js beginner...i'm trying to use lite-server in my app development.
I downloaded the repository in my app folder and I run lite-server command but nothing happens...can you help me to setup it correctly?

@johnpapa
Copy link
Owner

did you run npm install lite-server -g ? do that first then run it for globally using it.

run npm i lite-server --save-dev to run it for dev

@pierpy
Copy link
Author

pierpy commented Dec 30, 2015

the first was ok...
but the second give me :
GET https://registry.npmjs.org/lite.server
npm http 404 https://registry.npmjs.org/lite.server
npm ERR! TypeError: Cannot read property 'latest' of undefined
npm ERR! at next (/usr/share/npm/lib/cache.js:687:35)
npm ERR! at /usr/share/npm/lib/cache.js:675:5
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR! at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Linux 3.13.0-37-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "i" "lite.server" "--save-dev"
npm ERR! cwd /home/pierpaolo
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! type non_object_property_load
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pierpaolo/npm-debug.log
npm ERR! not ok code 0

@maheshk172
Copy link

I am facing this same issue. I am trying to run angular2-quickstart tutorial on Linux - Ubuntu 14.4 LTS version. The server starts properly and browser launch with http://localhost:3000 as well but then it stops with error.

I am using "lite-server": "^1.3.2" as mentioned on the tutorial.

Find below error details.

[BS] Watching files...
15.12.31 17:48:17 304 GET /./index.html (Unknown - 27ms)
15.12.31 17:48:17 304 GET /node_modules/angular2/bundles/angular2.dev.js (Unknown - 23ms)
15.12.31 17:48:17 304 GET /node_modules/es6-shim/es6-shim.js (Unknown - 24ms)
15.12.31 17:48:17 304 GET /node_modules/angular2/bundles/angular2-polyfills.js (Unknown - 14ms)
15.12.31 17:48:17 304 GET /node_modules/systemjs/dist/system.src.js (Unknown - 16ms)
15.12.31 17:48:17 304 GET /node_modules/rxjs/bundles/Rx.js (Unknown - 17ms)
15.12.31 17:48:18 304 GET /app/boot.js (Unknown - 348ms)
15.12.31 17:48:19 304 GET /app/app.component.js (Unknown - 85ms)
events.js:141
throw er; // Unhandled 'error' event
^

Error: watch node_modules/lite-server/node_modules/browser-sync/node_modules/serve-index/node_modules/http-errors/node_modules/inherits/test.js ENOSPC
at exports._errnoException (util.js:870:11)
at FSWatcher.start (fs.js:1234:19)
at Object.fs.watch (fs.js:1262:11)
at createFsWatchInstance (/home/mahesh/workspaces/AngularJS2Study/angular2-quickstart-typescript/node_modules/lite-server/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:37:15)

Could you please advise on this.

@xavierdutreilh
Copy link

@pierpy, are you sure that you typed lite-server and not lite.server? The following line seems to say the opposite: npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "i" "lite.server" "--save-dev".

@maheshk172, it seems to be an issue with browser-sync itself. BrowserSync/browser-sync#224 provides some answer on how to fix it.

@johnpapa
Copy link
Owner

johnpapa commented Jan 7, 2016

If on Ubuntu, running the following command might solve the problem:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Reference:
http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc

@johnpapa johnpapa closed this as completed Jan 7, 2016
@renevall
Copy link

@johnpapa works on ElementaryOS

@AdrianZelada
Copy link

very good @johnpapa thanks....

@msucil
Copy link

msucil commented Mar 23, 2016

i've included bs-config.json and it works for me.

{
 "injectChanges" : true,
  "files" : ["./**/*.{.html, htm, css, js, ts}","*.html"],
  "server" : { "baseDir":"./"}
}

@cbolivar-sts
Copy link

Hello John,

I am using the lite-server with AngularJS 2, but I have problem because when I try to get css files, the browser can't found it.

My folder structure is:

-- WebUI [root]
----- app (js,ts,map files)
----- css (css files to main page)
----- node_moudles
----- typings
-- index.html

That is my bs-config.json file:

{
  "port": 8000,
}

index.html has the following references:

 <!-- >> Custom Styles to Application [CSS] << -->
    <link href="css/app-custom-member-styles.css" rel="stylesheet"/>
    <link href="css/responsive-app.css" rel="stylesheet" />

But when I run, the browser can't find the css these files.

How can I do to lite server take internal folders (as work IIS)?

Thank you!

@PoojaGupta12
Copy link

Hey cbolivar-sts, Did you find the solution to this issue?

@georanma
Copy link

this worked for me @johnpapa. Thanks.

Very weird though that my set up was working, and then just kind of stopped. Not sure what changed during the course of the tutorial class Im working on.

@MacgyverMartins
Copy link

MacgyverMartins commented Oct 15, 2017

For anyone that comes here to finding out a solution to command not found: lite-server error
here it is:
if you installed by running npm i lite-server --save-dev
you should add this command on your package.json
for example: "dev": "lite-server". And then run npm run dev

But if you instal using npm i lite-server -g, then you would be able to run lite-server from your terminal

@ShivamChawla01
Copy link

I am also facing same issue with npm install lite-server --save-dev .
It starts installing but after a while it gets stuck at Fetchmetadata: sill resolveUsingNewModule.

@pazcur
Copy link

pazcur commented Sep 20, 2018

did you run npm install lite-server -g ? do that first then run it for globally using it.

run npm i lite-server --save-dev to run it for dev

Thank you @johnpapa that totally fixed my issue. For reference here's the error message that I got.
image

@Mtea994
Copy link

Mtea994 commented Oct 16, 2018

i am facing this issue while using terminal on vs code using windows OS

lite-server : The term 'lite-server' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name,
or if a path was included, verify that the path is correct and try again.

@kamalraj21
Copy link

did you run npm install lite-server -g ? do that first then run it for globally using it.

run npm i lite-server --save-dev to run it for dev

Worked for me as well, Thank you!

@ShivamChawla01
Copy link

ShivamChawla01 commented Apr 12, 2020 via email

@jayanthchundru
Copy link

:\git-test>npm start
npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jkcho\AppData\Roaming\npm-cache_logs\2020-04-18T13_48_56_816Z-debug.log

D:\git-test>
I am getting this kind of error

@pranita24sahay
Copy link

help

@ghazaljangid
Copy link

did you run npm install lite-server -g ? do that first then run it for globally using it.

run npm i lite-server --save-dev to run it for dev

thanks @johnpapa it totally worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests