Error installing Meteor on Centos 7

Hello to all. I’m trying to install Meteor on Centos 7 but i’m receiving the next error:

[root@host ~]# npm install -g meteor
/usr/bin/meteor-installer → /usr/lib/node_modules/meteor/cli.js

meteor@2.4.1 install /usr/lib/node_modules/meteor
node cli.js install

internal/fs/utils.js:332
throw err;
^

Error: EACCES: permission denied, mkdir ‘/usr/lib/node_modules/meteor/tmp->26284o5Wns6DxJKcO’
at Object.mkdirSync (fs.js:1013:3)
at Object.dirSync (/usr/lib/node_modules/meteor/node_modules/tmp/lib/tmp.js:351:6)
at Object. (/usr/lib/node_modules/meteor/install.js:47:22)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object. (/usr/lib/node_modules/meteor/cli.js:17:3) {
errno: -13,
syscall: ‘mkdir’,
code: ‘EACCES’,
path: ‘/usr/lib/node_modules/meteor/tmp-26284o5Wns6DxJKcO’
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! meteor@2.4.1 install: node cli.js install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meteor@2.4.1 install 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/2021-10-08T21_09_16_466Z-debug.log

As I can see, the issue is for the write permissions but i’m executing since root user and this is the owner. I have changed the permissions to 777 but the issue persist:

[root@host ~]# ls -la /usr/lib/ | grep node
drwxrwxrwx. 3 root root 25 oct 8 16:23 node_modules

This is my version of node.js and npm:

[root@host ~]# node -v
v14.18.0
[root@host ~]# npm -v
6.14.15

The operating system has been installed recently and this is the first time that I install Meteor. I have been searching information about this error but i don’t found.

I will be grateful for any information that you can contribute to me.

Thank you very much.

Hi !

At here Install the Latest Version of Meteor! is link to “refer to docs” where is

sudo npm install -g meteor --unsafe-perm

This does install Meteor to:

~/.meteor

For example:

/root/.meteor

To use Meteor as normal user, you could copy that folder to normal user, for example:

cp /root/.meteor /home/user/.meteor
sudo chown user:user /home/user
nano /home/user/.bashrc

And to that .bashrc add:

export PATH=$PATH:/home/user/.meteor

You can install newest npm:

sudo npm -g install npm

For running Meteor 2.2, it requires newest Node.js 12.x, so you can first install n for changing node version:

sudo npm -g install n

And then install Node.js:

sudo n 12.22.6

If you use Meteor 2.4, then install Node.js 14.x:

sudo n 14.18.0

And then logout and login, and check node version:

node -v

Some related install info is at wekan/rebuild-wekan.sh at master · wekan/wekan · GitHub

After building bundle, I have also some scripts that convert bundle to arm64/s390x/ppc64el using maintainer-make-bundle-*.sh scripts at wekan/releases at master · wekan/wekan · GitHub

Hi xe7, thanks for your answer.

I was trying with the command

sudo npm install -g meteor --unsafe-perm

But I get the following error:

[root@host ~]# sudo npm install -g meteor --unsafe-perm
/root/.npm-global/bin/meteor-installer -> /root/.npm-global/lib/node_modules/meteor/cli.js

> meteor@2.4.1 install /root/.npm-global/lib/node_modules/meteor
> node cli.js install

=> Meteor Downloaded in 30.351s
/root/.npm-global/lib/node_modules/meteor/install.js:29
  throw err;
  ^

Error: ENOENT: no such file or directory, open '/home/root/.meteor-install-started.txt'
    at Object.openSync (fs.js:497:3)
    at Object.writeFileSync (fs.js:1528:35)
    at b.<anonymous> (/root/.npm-global/lib/node_modules/meteor/install.js:130:8)
    at b.emit (events.js:400:28)
    at WriteStream.<anonymous> (/root/.npm-global/lib/node_modules/meteor/node_modules/node-downloader-helper/dist/index.js:1:9269)
    at WriteStream.emit (events.js:400:28)
    at emitCloseNT (internal/streams/destroy.js:87:10)
    at processTicksAndRejections (internal/process/task_queues.js:81:21) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/root/.meteor-install-started.txt'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! meteor@2.4.1 install: `node cli.js install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the meteor@2.4.1 install 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/2021-10-12T16_53_49_970Z-debug.log

I was reading about nvx but as I understand it, nvx is used to run applications without installing it. The following link shows package execution commands but not installation commands

I am installing Mozdef on a machine and for now I only need the Meteor to continue the installation process.

Thanks for your contribution

As I am a new user, I can only enter one link per response. Also, I followed the steps 1 to 6 in the next link:

And this one:

But the issue persist.

It complains you do not have this directory. Please create it:

mkdir -p /home/root