Skip to content

Common installation errors

Rafael Pegorari edited this page Sep 10, 2016 · 2 revisions

Common installation errors.

Errors uncatalogued installation.

Some errors are a bit as specific, most of them can be solved by running the command.

$ npm cache clean && npm update -g npm && npm install && npm rebuild

Module missing "node-gyp"

node-gyp is used for compiling native addon modules for Node.js.

$ npm install -g node-gyp

Documentation https://github.com/nodejs/node-gyp#installation

Erro "node-gyp rebuild"

node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.4.0
gyp info using node@6.4.0 | linux | x64
gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (/usr/lib/node_modules/node-gyp/lib/configure.js:449:14)
gyp ERR! stack     at /usr/lib/node_modules/node-gyp/lib/configure.js:353:11

Do not be surprised, perhaps you need to install any dependency. Example: On Unix:

  • python (v2.7 recommended, v3.x.x is not supported)
  • make
  • A proper C/C++ compiler toolchain, like GCC

In the above error we need to install the "python". Example Ubuntu 16

$ sudo apt-get install -y python-pip

View the dependency for your OS - https://github.com/nodejs/node-gyp#installation

Erro Gulp - Node-sass

ubuntu@ubuntu-xenial:~/dev/node/test$ gulp
[23:36:47] Using gulpfile ~/dev/node/test/gulpfile.js
[23:36:47] Starting 'clean'...
[23:36:47] Finished 'clean' after 73 ms
[23:36:47] Starting 'default'...
[23:36:47] Starting 'fonts'...
[23:36:47] Starting 'images'...
[23:36:47] Finished 'images' after 160 ms
[23:36:47] Starting 'style'...
[23:36:47] 'style' errored after 89 ms
[23:36:47] Error: ENOENT: no such file or directory, scandir '/home/ubuntu/dev/node/test/node_modules/node-sass/vendor'
    at Error (native)
    at Object.fs.readdirSync (fs.js:951:18)
    at Object.getInstalledBinaries (/home/ubuntu/dev/node/test/node_modules/node-sass/lib/extensions.js:119:13)
    at foundBinariesList (/home/ubuntu/dev/node/test/node_modules/node-sass/lib/errors.js:20:15)
    at foundBinaries (/home/ubuntu/dev/node/test/node_modules/node-sass/lib/errors.js:15:5)
    at Object.module.exports.missingBinary (/home/ubuntu/dev/node/test/node_modules/node-sass/lib/errors.js:45:5)
    at Object.<anonymous> (/home/ubuntu/dev/node/test/node_modules/node-sass/lib/index.js:15:28)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)

Solution

$ npm rebuild node-sass

Some module corrupted

Something has any error module corrupted or missing module.

$ npm cache clean && npm update -g npm

then reinstall your project.

Missing public/images/favicon.png

$ meanstack serve
Unhandled rejection Error: Error: ENOENT: no such file or directory, stat '/home/ubuntu/dev/node/test/public/images/favicon.png'
    at /home/ubuntu/dev/node/test/node_modules/meanstack/lib/foundation/Application.js:80:19
    at runCallback (timers.js:574:20)
    at tryOnImmediate (timers.js:554:5)
    at processImmediate [as _immediateCallback] (timers.js:533:5)

This error is caused by forgetting to run "Gulp". The public directory is built by Gulp.

$ gulp

Error install in file /home/ubuntu/.npm/preserve/0.2.0/package/package.json

ubuntu@ubuntu-xenial:~/dev/node$ meanstack new meanstack-0.3.6
Crafting application...
Cloning MEANStack.io git clone -b master https://github.com/meanstack-io/meanstack.io.git meanstack-0.3.6
Cloning into 'meanstack-0.3.6'...
Cloned MEANStack.io
Preparing application...
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm ERR! Linux 4.4.0-24-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.4.0
npm ERR! npm  v3.10.7
npm ERR! file /home/ubuntu/.npm/preserve/0.2.0/package/package.json
npm ERR! code EJSONPARSE

npm ERR! Failed to parse json
npm ERR! Unexpected end of input at 1:1452
npm ERR! reveil@gmail.com"},{"name":"Leonardo","email":"leofiore@libero.it"},{
npm ERR!                                                                      ^
npm ERR! File: /home/ubuntu/.npm/preserve/0.2.0/package/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR! 
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/dev/node/meanstack-0.3.6/npm-debug.log
1

Soluction

ubuntu@ubuntu-xenial:~/dev/node/meanstack-0.3.6$ npm cache clean
ubuntu@ubuntu-xenial:~/dev/node/meanstack-0.3.6$ npm update -g npm
ubuntu@ubuntu-xenial:~/dev/node/meanstack-0.3.6$ npm install && npm rebuild

kerberos

> kerberos@0.0.18 install /home/ubuntu/dev/node/test/node_modules/kerberos
> (node-gyp rebuild) || (exit 0)

make: Entering directory '/home/ubuntu/dev/node/test/node_modules/kerberos/build'
  CXX(target) Release/obj.target/kerberos/lib/kerberos.o
In file included from ../lib/kerberos.cc:1:0:
../lib/kerberos.h:5:27: fatal error: gssapi/gssapi.h: No such file or directory
compilation terminated.
kerberos.target.mk:98: recipe for target 'Release/obj.target/kerberos/lib/kerberos.o' failed
make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1
make: Leaving directory '/home/ubuntu/dev/node/test/node_modules/kerberos/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 4.4.0-24-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ubuntu/dev/node/test/node_modules/kerberos
gyp ERR! node -v v6.4.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 

MEANStack uses the Mongoose for modeling MongoDB which in turn uses the official drive MongoDB using Kerberos. The only native extension is the kerberos extension. This is a peerDependency for the mongodb module. This means that if you need to use kerberos you will need to add the kerberos module to your modules dependencies.

Dependencies

  • krb5-devel / libkrb5-dev
  • build-essential or gcc g++ make

Solution for Ubuntu / Debian

$ sudo apt-get install build-essential
$ sudo apt-get install libkrb5-dev
$ cd yourproject/ && npm rebuild

If you are unable to resolve your problem install the Kerberos project and compile it. https://github.com/christkv/kerberos#diagnosing-on-unix

Debug instalation

If you want to make the steps of the "meanstack new yourproject".

Clone project

$ git clone -b master https://github.com/meanstack-io/meanstack.io.git yourproject

Install dependencies

$ cd yourproject && npm install && bower install

Copy env file

$ cp .env.example.js .env.js

Compile Gulpfile

$ gulp