I installed nodejs on ubuntu 16.04 like this:
I run it on an apache though.
My first application hello.js (saved in /var/www/html/nodejs/) is:
#!/usr/bin/env nodejs
var http = require('http');
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World! Node.js is working correctly!\n');
}).listen(8080);
console.log('Server running at http://localhost:8080/');
When I enter in the browser http://localhost:8080/ I get:
Hello World! Node.js is working correctly!
Now I want to install browser-sync like suggested here:
Using browser-sync with node.js app
But when I run:
$ sudo npm install browser-sync gulp --save-dev
I get the following:
npm WARN registry Using stale data from https://registry.npmjs.org/ because the host is inaccessible -- are you offline?
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
> [email protected] install /home/sven/node_modules/uws
> node-gyp rebuild > build_log.txt 2>&1 || exit 0
sh: 1: cannot create build_log.txt: Permission denied
npm WARN saveError ENOENT: no such file or directory, open '/home/sven/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/sven/package.json'
npm WARN sven No description
npm WARN sven No repository field.
npm WARN sven No README data
npm WARN sven No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"ia32"})
+ [email protected]
+ [email protected]
added 547 packages in 57.958s
Is browser-sync now installed? And why am I getting so many WARN? Is this suppose to be like this? I'm new to nodejs ...