I have downloaded the nodejs repository from nodejs website and I want to install it via node file in bin directory and I want to install it with gdebi or software installer app but the error is: for gdebi and for software installer actually I have checked the permissions and activated them and this is the error while I run npx create-react-app name
internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module 'ini'
Require stack:
- /usr/share/nodejs/#npmcli/config/lib/index.js
- /usr/share/nodejs/npm/lib/utils/config/definition.js
- /usr/share/nodejs/npm/lib/utils/config/definitions.js
- /usr/share/nodejs/npm/lib/utils/config/flatten.js
- /usr/share/nodejs/npm/lib/utils/config/index.js
- /usr/share/nodejs/npm/bin/npx-cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/share/nodejs/#npmcli/config/lib/index.js:3:13)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/share/nodejs/#npmcli/config/lib/index.js',
'/usr/share/nodejs/npm/lib/utils/config/definition.js',
'/usr/share/nodejs/npm/lib/utils/config/definitions.js',
'/usr/share/nodejs/npm/lib/utils/config/flatten.js',
'/usr/share/nodejs/npm/lib/utils/config/index.js',
'/usr/share/nodejs/npm/bin/npx-cli.js'
]
}
that's just an archive file, not a debian package so dont try to open it with a package manager
it looks like you downloaded an arm version of nodejs, are you sure you are on arm ?
if you don't need that specific version of nodejs, you can install it threw the command line apt install nodejs -y
just some extra packages remaining from past which I could handle with sudo apt autoremove and sudo apt autoclean then I reinstalled nodejs via terminal
Related
I recently updated my operating system, which is Pop-OS, which is a Ubuntu's distribution. Before updating, I could run nodejs with ZeroMQ perfectly. Now, I can't run any file with ZeroMQ, not even with just this SLOC-line: const zmq = require('zeromq')
I am using Visual Studio code and also I tried to uninstall and install from scratch nodejs and npm and nothing works.
This is the error:
myuser#pop-os:~/Documents/Lab/fuentes$ node publicadorServer.js
node:internal/modules/cjs/loader:922
throw err;
^
Error: Cannot find module '../build/Release/zmq.node'
Require stack:
- /home/myuser/node_modules/zeromq/lib/index.js
- /home/myuser/node_modules/zeromq/index.js
- /home/myuser/Documents/Lab/fuentes/publicadorServer.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:15)
at Function.Module._load (node:internal/modules/cjs/loader:763:27)
at Module.require (node:internal/modules/cjs/loader:991:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/home/myuser/node_modules/zeromq/lib/index.js:6:11)
at Module._compile (node:internal/modules/cjs/loader:1102:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
at Module.load (node:internal/modules/cjs/loader:967:32)
at Function.Module._load (node:internal/modules/cjs/loader:807:14)
at Module.require (node:internal/modules/cjs/loader:991:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/myuser/node_modules/zeromq/lib/index.js',
'/home/myuser/node_modules/zeromq/index.js',
'/home/myuser/Documents/Lab/fuentes/publicadorServer.js'
]
}
I have installed ZeroMQ with this command at the directory of the project : npm install zeromq#5
Any help would be appreciated.
Finally I could fix it, only with the command npm rebuild.
Unbelievable. I guess, installing a new version of node and the new operating system version make necessary to rebuild it, but I still don't understand that, if I uninstall nodejs and npm, why it was not working. Fortunately, it's all fixed.
I wrote an app with node.js, which uses the argon2 module for hashing passwords.
Running on my local (Windows) machine, everything was fine.
When I installed the app on my Linux server, I had errors installing the modules. However, once I updated the server to Node.js v12.18.3, reinstalling the modules completed successfully.
Unfortunately, when I attempted to actually run the app, I got the following error:
>$ node app.js
internal/modules/cjs/loader.js:1187
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/{CENSORED FOR PRIVACY}/node_modules/argon2/lib/binding/napi-v3/argon2.node)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1187:18)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/{CENSORED FOR PRIVACY}/node_modules/argon2/argon2.js:9:56)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/{CENSORED FOR PRIVACY}/models/Users.js:2:16)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
Any ideas how to fix this?
I tried running:
LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
as suggested here, but it did not help.
I had the same problem with argon2 on CentOS 7.
Solved this like that:
yum install gmp-devel mpfr-devel libmpc-devel wget
wget https://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.gz
mkdir gcc-8.3.0-build
tar xf gcc-8.3.0.tar.gz
cd gcc-8.3.0-build
../gcc-8.3.0/configure --enable-languages=c,c++ --disable-multilib
make && make install
export LD_LIBRARY_PATH=/usr/local/lib64:${LD_LIBRARY_PATH}
As proposed here
To note, in my case, "make" and "make install" commands took about 2 hours to complete. And I needed them to run as a root. I think, you should export LD_LIBRARY_PATH, as shown in last step, each time you open terminal to run your node js app.
As I installed electron 8.2 successfully on my linux, I encountered this error while I ran the cli command:
electron .
/usr/local/lib/node_modules/electron/index.js:14
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
^
Error: Electron failed to install correctly, please delete
node_modules/electron and try installing again
at getElectronPath (/usr/local/lib/node_modules/electron/index.js:14:11)
at Object. (/usr/local/lib/node_modules/electron/index.js:18:18)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object. (/usr/local/lib/node_modules/electron/cli.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
Well, it seems the problem is with the usr/local/lib/node_modules/electron folder.
It seemed installed improperly.
So, I copied the node_modules/electron/dist folder in local project and pasted in the global folder mentioned above and :
wooooooooohoooooooooo!!!! solved
I deal with an error with the installation of nodejs and less on a Centos 7 server.
My aim is to install a Symfony2 application on a new server (Centos 7). My application use less files, including for Twitter Bootstrap.
For Symfony2, I declare the following :
assetic:
filters:
cssrewrite: ~
less:
node: "/usr/local/bin/node"
node_paths: ["/usr/local/lib/node_modules"]
apply_to: "\.less$"
I followed this tutorial for the installation of node/npm and after less : https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-a-centos-7-server.
Everything seems to bve alright, the command node -v works like npm -v. I launch this command for less :
sudo npm install less -g
I test a simple compilation of a style.less file in command line like :
$ lessc style.less style.css
No problem.
BUT when I run the Symfony2 command :
php app/console assetic:dump --env=prod
I have the error bellow :
[Assetic\Exception\FilterException]
An error occurred while running:
'/usr/local/bin/node' '/tmp/assetic_lessKtMIZV'
Error Output:
module.js:338
throw err;
^
Error: Cannot find module 'less'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/tmp/assetic_lessKtMIZV:1:74)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
Node is well in /usr/local/bin/node
Node modules are well in : /usr/local/lib/node_modules
Any idea ? Thanks
I finally found the problem. It was in my parameters.yml files.
http://www.developpez.net/forums/d1514993/php/bibliotheques-frameworks/symfony2/installation-nodejs-less-symfony2-sous-centos-7-a/
Error: Cannot find module '.-audio'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (F:\Stage_ete_2018_XperMedia\2eme stage\transcription-service-master\bin\lib\job.js:6:25)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
I already did :
npm install
npm install -audio
then after executing a google-cloud Error pop up and so on, if install one module the other pop up.
npm install -audio
This does nothing, it ignores non existing options that start with a -. NPM also does not give an error, as I tried with -something_that_does_exists_for_sure as an option.
I guess you want to install the audio package: https://github.com/audiojs/audio
npm install audio
+ audio#1.2.0
added 2 packages in 1.97s
It should read that it added two packages, I think you didnt install it yet.
Also I do not understand the .- in your error:
Error:Cannot find module '.-audio'
Below is how the code example looks like in the audio package readme. See it has no dots, nor minus symbols.
const Audio = require('audio')
Audio.load('./sample.mp3').then(audio =>
audio
.trim()
.normalize()
.fade(.5)
.fade(-.5)
.save('sample-edited.wav')
)
I guess you also need to remove those from your code. Dots are only needed if you want to require files from a certain directory, not for packages installed with NPM.
You can try with this once,
Remove node_modules folder from your project directory
npm install
npm install <your_package_name> --save