Problem met when installing Quasar-cli on CentOS



  • I tried to install Quasar-cli on CentOS and failed. Related code is as follow.
    May anyone help me… Usually I work on Ubuntu and I am not so familiar with CentOS.
    Thanks a lot!
    (I installed nodejs by downloading source code from https://nodejs.org/dist/v8.11.3/node-v8.11.3.tar.gz and using sudo make install.)

    [root@VM_223_80_centos ~]# sudo npm install -g quasar-cli
    npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!
    /usr/local/bin/quasar -> /usr/local/lib/node_modules/quasar-cli/bin/quasar
    
    > quasar-cli@0.16.4 postinstall /usr/local/lib/node_modules/quasar-cli
    > node lib/node-version-check.js
    
    sh: node: command not found
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/quasar-cli/node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
    
    npm ERR! file sh
    npm ERR! code ELIFECYCLE
    npm ERR! errno ENOENT
    npm ERR! syscall spawn
    npm ERR! quasar-cli@0.16.4 postinstall: `node lib/node-version-check.js`
    npm ERR! spawn ENOENT
    npm ERR!
    npm ERR! Failed at the quasar-cli@0.16.4 postinstall 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!     /root/.npm/_logs/2018-07-14T07_17_02_150Z-debug.log
    [root@VM_223_80_centos ~]# npm -v
    6.2.0
    [root@VM_223_80_centos ~]# node -v
    v8.11.3
    [root@VM_223_80_centos ~]# echo $PATH
    /usr/local/sbin:./usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/bin/:/root/bin
    
    


  • I have solved this problem by re-installing nodejs.
    I downloaded Linux Binaries (instead of downloading Source Code and compiling it with my computer) this time, and the installation was perfect.
    Maybe there was something wrong in my previous nodejs installation method. XD



  • I found it helpful, when using nvm to do the following:
    nvm alias default v8.11.1