LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-27-2016, 09:50 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Rep: Reputation: Disabled
Installing nodejs and npm on Centos


I installed nodejs and npm per https://nodejs.org/en/download/packa...nux-and-fedora. Note that the document states to use yum -y install nodejs without adding npm. But when I use npm, it appears not to be installed:
Code:
[Michael@devserver laravel3]$ npm install

module.js:340
    throw err;
          ^
Error: Cannot find module '../lib/npm.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at /usr/lib/node_modules/npm/bin/npm-cli.js:24:11
    at Object.<anonymous> (/usr/lib/node_modules/npm/bin/npm-cli.js:86:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
[Michael@devserver laravel3]$
So, then I remove and re-install nodejs and npm, but get the follow error.:
Code:
[root@devserver ~]# yum install -y nodejs npm
Error unpacking rpm package npm-1.3.6-5.el6.noarch
error: unpacking of archive failed on file /usr/lib/node_modules/npm/doc: cpio: rename
...
Failed:
  npm.noarch 0:1.3.6-5.el6
So, then I uninstalled again, and this time deleted the modules using rm -rf /usr/lib/node_modules, and success, nodejs.x86_64 0:0.10.46-1.el6 and npm.noarch 0:1.3.6-5.el6 were installed!

So, I try "npm install", but get the following errors. /var/www/laravel2/npm-debug.log seems to repeat what is displayed below. When I tried it a second time (this time as sudo, but it made no difference), it says the RSA key fingerprint is wrong. I've tried uninstalling both nodjs and npm and reinstalling using yum, but no change.

It looks like the initial error is: error Error: No compatible version found: webpack@'>=2.1.0-beta.15 <=2.1.0--beta.22'


Anyone know what is going on?

Thanks

Code:
[Michael@devserver laravel2]$ npm install

... a bunch of installs..

> node-sass@3.13.0 install /var/www/laravel2/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/Michael/.npm/node-sass/3.13.0/linux-x64-11_binding.node

> node-sass@3.13.0 postinstall /var/www/laravel2/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass
> node scripts/build.js

Binary found at /var/www/laravel2/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-11/binding.node
Testing binary
Binary is fine

> node-sass@3.13.0 install /var/www/laravel2/node_modules/laravel-elixir-vue-2/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/Michael/.npm/node-sass/3.13.0/linux-x64-11_binding.node

> node-sass@3.13.0 postinstall /var/www/laravel2/node_modules/laravel-elixir-vue-2/node_modules/node-sass
> node scripts/build.js

Binary found at /var/www/laravel2/node_modules/laravel-elixir-vue-2/node_modules/node-sass/vendor/linux-x64-11/binding.node
Testing binary
Binary is fine
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /var/www/laravel2/npm-debug.log
npm ERR! not ok code 0
Code:
[Michael@devserver laravel2]$ sudo npm install
[sudo] password for Michael:
npm http GET https://registry.npmjs.org/laravel-elixir-webpack-official
npm http 200 https://registry.npmjs.org/laravel-elixir-webpack-official
npm http GET https://registry.npmjs.org/laravel-elixir-webpack-official/-/laravel-elixir-webpack-official-1.0.9.tgz
npm http 200 https://registry.npmjs.org/laravel-elixir-webpack-official/-/laravel-elixir-webpack-official-1.0.9.tgz
npm http GET https://registry.npmjs.org/buble
npm http GET https://registry.npmjs.org/buble-loader
npm http GET https://registry.npmjs.org/webpack
npm http GET https://registry.npmjs.org/webpack-stream
npm http 200 https://registry.npmjs.org/buble-loader
npm http GET https://registry.npmjs.org/buble-loader/-/buble-loader-0.2.2.tgz
npm http 200 https://registry.npmjs.org/webpack-stream
npm http 200 https://registry.npmjs.org/buble
npm http GET https://registry.npmjs.org/buble/-/buble-0.12.5.tgz
npm http 200 https://registry.npmjs.org/webpack
npm ERR! Error: No compatible version found: webpack@'>=2.1.0-beta.15 <=2.1.0--beta.22'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5","0.1.6","0.2.0","0.2.1","0.2.2","0.2.3","0.2.4","0.2.6","0.2.7","0.2.8","0.3.0","0.3.1","0.3.2","0.3.3","0.3.4","0.3.6","0.3.7","0.3.8","0.3.9","0.3.10","0.3.11","0.3.12","0.3.13","0.3.14","0.3.15","0.3.16","0.3.17","0.3.18","0.3.19","0.3.20","0.4.0","0.4.1","0.4.2","0.4.3","0.4.4","0.4.5","0.4.6","0.4.7","0.4.8","0.4.9","0.4.10","0.4.11","0.4.12","0.4.13","0.4.14","0.4.15","0.4.16","0.4.17","0.4.18","0.4.19","0.4.20","0.4.21","0.4.23","0.4.24","0.4.25","0.5.0","0.5.1","0.5.2","0.5.3","0.5.4","0.5.5","0.5.6","0.5.7","0.5.8","0.5.10","0.6.0","0.6.1","0.6.2","0.7.0-beta","0.7.0-beta2","0.7.0-beta3","0.7.0-beta4","0.7.0-beta5","0.7.0-beta6","0.7.0-beta7","0.7.0-beta8","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","0.7.5","0.7.6","0.7.7","0.7.8","0.7.9","0.7.11","0.7.12","0.7.13","0.7.14","0.7.15","0.7.16","0.7.17","0.8.0-beta1","0.8.0-beta2","0.8.0-beta3","0.8.0-beta4","0.8.0","0.8.2","0.8.3","0.9.0-beta1","0.9.0-beta2","0.9.0-beta4","0.9.0-beta5","0.9.0-beta6","0.9.0-beta7","0.9.0-beta8","0.9.0-beta9","0.9.0-beta10","0.9.0-beta11","0.9.0-beta12","0.9.0-beta13","0.9.0-beta14","0.9.0-beta15","0.9.0-beta16","0.9.0-beta17","0.9.0-beta18","0.9.0-beta19","0.9.0-beta20","0.9.0-beta21","0.9.0-beta22","0.9.0-beta23","0.9.0-beta24","0.9.0-beta25","0.9.0-beta26","0.9.0-beta27","0.9.0-beta28","0.9.0-beta29","0.9.0-beta30","0.9.0-beta31","0.9.0-beta32","0.9.0-beta33","0.9.0-beta34","0.9.0-beta35","0.9.0-beta36","0.9.0-beta37","0.9.0-beta38","0.9.0","0.9.1","0.9.2","0.9.3","0.10.0-beta2","0.10.0-beta3","0.10.0-beta5","0.10.0-beta6","0.10.0-beta7","0.10.0-beta8","0.10.0-beta9","0.10.0-beta10","0.10.0-beta11","0.10.0-beta12","0.10.0-beta13","0.10.0-beta14","0.10.0-beta15","0.10.0-beta16","0.10.0-beta17","0.10.0-beta18","0.10.0-beta19","0.10.0-beta20","0.10.0-beta21","0.10.0-beta22","0.10.0-beta23","0.10.0-beta24","0.10.0-beta25","0.10.0","0.11.0-beta1","0.11.0-beta2","0.11.0-beta3","0.11.0-beta4","0.11.0-beta5","0.11.0-beta6","0.11.0-beta7","0.11.0-beta8","0.11.0-beta9","0.11.0-beta10","0.11.0-beta11","0.11.0-beta12","0.11.0-beta13","0.11.0-beta14","0.11.0-beta15","0.11.0-beta16","0.11.0-beta17","0.11.0-beta18","0.11.0-beta19","0.11.0-beta20","0.11.0-beta21","0.11.0-beta22","0.11.0-beta23","0.11.0-beta24","0.11.0-beta25","0.11.0-beta26","0.11.0-beta27","0.11.0-beta28","0.11.0-beta29","0.11.0","0.11.1","0.11.2","0.11.3","0.11.4","0.11.5","0.11.6","0.11.7","0.11.8","0.11.9","0.11.10","0.11.11","0.11.12","0.11.13","0.11.14","0.11.15","1.0.0-beta1","1.0.0-beta2","1.0.0-beta3","1.0.0-beta4","0.11.16","0.11.17","0.11.18","1.0.0-beta5","1.0.0-beta6","1.0.0-beta7","1.0.0-beta8","1.0.0-beta9","1.0.0-rc1","1.0.0-rc2","1.0.0-rc3","1.0.0-rc4","1.0.0-rc5","1.0.0-rc7","1.0.0-rc8","1.0.0-rc9","1.0.0-rc11","1.0.0-rc12","1.0.0","1.0.1","1.0.3","1.0.4","1.0.5","1.1.0-beta1","1.1.0-beta2","1.1.0-beta3","1.1.0-beta4","1.1.0-beta5","1.1.0-beta6","1.1.0-beta7","1.1.0-beta8","1.1.0-beta9","1.1.0-beta10","1.1.0-beta12","1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.1.6","1.1.7","1.1.8","1.1.9","1.1.10","1.1.11","1.2.0-beta1","1.2.0-beta2","1.2.0-beta4","1.2.0-beta5","1.2.0-beta6","1.3.0-beta1","1.3.0-beta2","1.3.0-beta3","1.3.0-beta4","1.3.0-beta5","1.3.0-beta6","1.3.0-beta7","1.3.0-beta8","1.3.0-beta9","1.3.1-beta1","1.3.1-beta2","1.3.1-beta3","1.3.1-beta4","1.3.1-beta5","1.3.1-beta6","1.3.1-beta7","1.3.1-beta8","1.3.1-beta9","1.3.2-beta1","1.3.2-beta2","1.3.2-beta3","1.3.2-beta4","1.3.2-beta5","1.3.2-beta6","1.3.2-beta7","1.3.2-beta8","1.3.2-beta9","1.3.3-beta1","1.3.3-beta2","1.3.4","1.3.5","1.3.6","1.3.7","1.4.0-beta1","1.4.0-beta2","1.4.0-beta3","1.4.0-beta4","1.4.0-beta5","1.4.0-beta6","1.4.0-beta7","1.4.0-beta8","1.4.0-beta9","1.4.0-beta10","1.4.1-beta1","1.4.2","1.4.3","1.4.4","1.4.5","1.4.6","1.4.7","1.4.8","1.4.9","1.4.10","1.4.11","1.4.12","1.4.13","1.4.14","1.4.15","1.5.0","1.5.1","1.5.2","1.5.3","1.6.0","1.7.0","1.7.1","1.7.2","1.7.3","1.8.0","1.8.1","1.8.2","1.8.3","1.8.4","1.8.5","1.8.6","1.8.7","1.8.8","1.8.9","1.8.10","1.8.11","1.9.0","1.9.1","1.9.2","1.9.3","1.9.4","1.9.5","1.9.6","1.9.7","1.9.8","1.9.9","1.9.10","1.9.11","1.9.12","1.9.13","1.10.0","1.10.1","1.10.2","1.10.3","1.10.4","1.10.5","1.11.0","1.12.0","1.12.1","1.12.2","2.0.0-beta","1.12.3","1.12.4","1.12.5","1.12.6","1.12.7","1.12.8","1.12.9","2.0.1-beta","2.0.2-beta","1.12.10","1.12.11","2.0.4-beta","1.12.12","2.0.5-beta","2.0.6-beta","2.0.7-beta","1.12.13","2.1.0-beta.0","2.1.0-beta.1","2.1.0-beta.2","1.12.14","2.1.0-beta.3","2.1.0-beta.4","2.1.0-beta.5","1.12.15","1.13.0","2.1.0-beta.6","2.1.0-beta.7","1.13.1","2.1.0-beta.8","2.1.0-beta.9","2.1.0-beta.10","2.1.0-beta.11","2.1.0-beta.12","2.1.0-beta.13","2.1.0-beta.14","2.1.0-beta.15","2.1.0-beta.16","2.1.0-beta.17","2.1.0-beta.18","2.1.0-beta.19","2.1.0-beta.20","2.1.0-beta.21","1.13.2","2.1.0-beta.22","2.1.0-beta.23","2.1.0-beta.24","2.1.0-beta.25","1.13.3","2.1.0-beta.26","2.1.0-beta.27"]
npm ERR!     at installTargetsError (/usr/lib/node_modules/npm/lib/cache.js:719:10)
npm ERR!     at next (/usr/lib/node_modules/npm/lib/cache.js:698:17)
npm ERR!     at /usr/lib/node_modules/npm/lib/cache.js:675:5
npm ERR!     at saved (/usr/lib/node_modules/npm-registry-client/lib/get.js:148:7)
npm ERR!     at /usr/lib/node_modules/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:108: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!     <npm-@googlegroups.com>

npm ERR! System Linux 2.6.32-642.6.2.el6.x86_64
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/laravel2
npm ERR! node -v v0.10.46
npm ERR! npm -v 1.3.6
npm http 200 https://registry.npmjs.org/buble-loader/-/buble-loader-0.2.2.tgz
npm http 200 https://registry.npmjs.org/buble/-/buble-0.12.5.tgz
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? no
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /var/www/laravel2/npm-debug.log
npm ERR! not ok code 0
[Michael@devserver laravel2]$
I also tried the following to no avail:
Code:
[root@devserver ~]# npm install -g npm@latest
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
npm WARN unmet dependency /usr/lib/node_modules/block-stream requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream-ignore requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream-npm requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/glob requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/npmconf requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/tar requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm@4.0.2 /usr/lib/node_modules/npm
[root@devserver ~]#

Last edited by NotionCommotion; 11-27-2016 at 11:32 AM.
 
Old 11-28-2016, 07:59 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
You might have to update npm. npm is packaged with nodejs, but it is updated more often than nodejs. So, check which version of npm you have
Code:
$ npm -v
and then check what the latest version is. Update if necessary.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to install NodeJS, Bower and Gulp on a CentOS 7 VPS LXer Syndicated Linux News 0 08-22-2014 03:04 AM
LXer: NPM creator starts a company to offer npm-related products and services LXer Syndicated Linux News 0 01-17-2014 09:50 AM
[SOLVED] npm binary yashfire007 Linux - Newbie 4 05-15-2013 09:40 AM
[SOLVED] nodejs, nodejs-dev incompatibility in Ubintu? mjbradakis Linux - Software 1 03-24-2013 11:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration