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
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.
[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.
Hi xet7,
I have been doing different tests,
I had to reinstall the operating system as I did not have enough space allocated in / home.
I ran the command and the following came out in a normal user:
[user@host ~]$ sudo npm install -g meteor --unsafe-perm
[sudo] password for host:
changed 46 packages, and audited 47 packages in 4s
2 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[user@host ~]$ sudo which meteor
which: no meteor in (/sbin:/bin:/usr/sbin:/usr/bin)
[user@host ~]$
this is the error if I use the root user:
[root@host ~]# nvm use 16
Now using node v16.11.1 (npm v8.0.0)
[root@host ~]#
[root@host ~]#
[root@host ~]# npm install -g meteor
npm ERR! code 1
npm ERR! path /root/.nvm/versions/node/v16.11.1/lib/node_modules/meteor
npm ERR! command failed
npm ERR! command sh -c node cli.js install
npm ERR! node:internal/modules/cjs/loader:936
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module '/root/.nvm/versions/node/v16.11.1/lib/node_modules/meteor/cli.js'
npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:778:27)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
npm ERR! at node:internal/main/run_main_module:17:47 {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: []
npm ERR! }
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-10-15T21_37_50_311Z-debug.log
it’s as if the installer couldn’t find the path ‘/root/.nvm/versions/node/v16.11.1/lib/node_modules/meteor/cli.js’ which in effect was not in that location so I found it in the path /usr/lib/node_modules/meteor/ and pasted it in the path requested by the installer.
[root@host ~]# ls -la /root/.nvm/versions/node/v16.11.1/lib/node_modules/meteor/
total 36
drwxr-xr-x. 3 root root 186 oct 13 16:28 .
drwxr-xr-x. 5 1001 1001 63 oct 15 16:37 ..
-rwxr-xr-x. 1 root root 430 oct 13 16:28 cli.js
-rw-r--r--. 1 root root 915 oct 13 16:28 config.js
-rw-r--r--. 1 root root 2991 oct 13 16:28 extract.js
-rw-r--r--. 1 root root 6958 oct 13 16:28 install.js
drwxr-xr-x. 47 root root 4096 oct 13 16:28 node_modules
-rw-r--r--. 1 root root 475 oct 13 16:28 package.json
-rw-r--r--. 1 root root 1872 oct 13 16:28 README.md
-rw-r--r--. 1 root root 412 oct 13 16:28 uninstall.js
but the error remains the same.
I will try it with the Legacy Installation Method and making the modifications that you has been indicated me in the first answer to be able to use Meteor as a normal user. Although I am concerned that the page says that This installation method is not maintained anymore.
I will tell you if I can do the installation or if it generates a new error.
You do not run nvm as root - bad practice and insecure
Create a user and setup the shell and home directory, set the env vars there with export and add to .bashrc or .bash_profile
Install the build tar gz to the user directory , untar the deployment tarball you scp’d to the server that you made from your local development with meteor build and do cd bundle then (cd programs/server && npm install) to install your app as a production instance, start with node main.js
If centos is your local development you should be using your user not root to work on it should be in /home/username/.nvm you do not do development on production and it will expose your code you only send the server tarball file there
Ok, I changed to the version 14 but I have the same initial error
[root@host ~]# nvm use 14
Now using node v14.18.1 (npm v6.14.15)
[root@host ~]#
[root@host ~]# npm install -g meteor
/root/.nvm/versions/node/v14.18.1/bin/meteor-installer -> /root/.nvm/versions/node/v14.18.1/lib/node_modules/meteor/cli.js
> meteor@2.4.1 install /root/.nvm/versions/node/v14.18.1/lib/node_modules/meteor
> node cli.js install
internal/fs/utils.js:332
throw err;
^
Error: EACCES: permission denied, mkdir '/root/.nvm/versions/node/v14.18.1/lib/node_modules/meteor/tmp-113614QvpPfG52P8q'
at Object.mkdirSync (fs.js:1013:3)
at Object.dirSync (/root/.nvm/versions/node/v14.18.1/lib/node_modules/meteor/node_modules/tmp/lib/tmp.js:351:6)
at Object.<anonymous> (/root/.nvm/versions/node/v14.18.1/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.<anonymous> (/root/.nvm/versions/node/v14.18.1/lib/node_modules/meteor/cli.js:17:3) {
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path: '/root/.nvm/versions/node/v14.18.1/lib/node_modules/meteor/tmp-113614QvpPfG52P8q'
}
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-19T20_18_39_347Z-debug.log
[root@host ~]#
Well, I needed to install Meteor and verify that it can run as it is required as a plug-in for Mozdef to work. I had to reinstall it with the legacy install method as with NPM it kept crashing.
[root@host ~]# su user
[user@host root]$
[user@host root]$ cd /home/user/my_app/
[user@host my_app]$
[user@host my_app]$ meteor
[[[[[ ~/my_app ]]]]]
=> Started proxy.
=> Started HMR server.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:3000/