Error in running Electron CLI in Ubuntu-18.04 - linux

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

Related

Node Module argon2 "/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.8' not found"

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.

Trying to create Vue app, but getting "SyntaxError: Unexpected identifier" when running command in terminal

I have been working in AngularJS for a while now and I decided to try out Vue. I installed Vue using npm install -g #vue/cli in my terminal using Node version 6.4.0. After the installation was complete I tried creating a new app using vue create <name of app>. It's during this seemingly simple step that I am getting hung up with this error:
/Users/jonalden/.nvm/versions/node/v6.4.0/lib/node_modules/#vue/cli/node_modules/open/index.js:16
const wslToWindowsPath = async path => {
^^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:528:28)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/jonalden/.nvm/versions/node/v6.4.0/lib/node_modules/#vue/cli/node_modules/#vue/cli-shared-utils/lib/openBrowser.js:9:14)
at Module._compile (module.js:556:32)
I have tried downgrading Node to a previous version and reinstalling Vue with Yarn but both were unsuccessful. One thing throwing me off here is the line wslToWindowsPath, which is especially weird since I am on a Mac.
I had the same problem. I've done this :
sudo rm -rf ~/.nvm

Firebase function Cannot find module 'cycle'

When I try to run any firebase command I get this error.
internal/modules/cjs/loader.js:596
throw err;
^
Error: Cannot find module 'cycle'
at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/usr/local/lib/node_modules/firebase- tools/node_modules/winston/lib/winston/common.js:11:13)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js
(internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
I am on
node.js version v10.5.0
npm version 6.1.0
OS Linux Mint 18.3
The files in /usr/local/lib/node_modules/firebase-tools/node_modules are not being updated and installed as expected. Many of the modules are missing.
I had installed firebase locally into what I am going to use as my firebase directory. All of the modules where there. So I copied the files from the local node_modules folder to the global node_modules folder.
To note, this is a bandage to the problem as anytime you go to update firebase you will need to repeat this process.

NodeJS stopped working after changing version

I was working on Node version 9.1.0 but the client asked me to use NVM so that the version can be switched at will. I tried but it was not working. So I uninstalled NodeJS from my windows machine and did a fresh install of NodeJS version 8.9.4
After npm install when I tried to execute the code I got this error:
SyntaxError: Unexpected number
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:607:28)
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)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\inetpub\wwwroot\NodeJS_APIs\api\node_modules\lodash\isFunction.js:1:80)
The line that trew the error is in vm.js:
function createScript(code, options) {
return new Script(code, options);//This is the line
}
I don't understand what went wrong. Can someone please explain what am I doing wrong?
From your error stacktrace it seems the error is related to your loadash library, Can you please try uninstalling it using,
npm uninstall lodash
And then reinstall a compatible lodash version like this,
npm install lodash#4.17.5
Once done, try running your script again.
Hope this helps!
You might get some hints from here, although I’m not sure: https://github.com/rollup/rollup/issues/2054

Meteor error with windows 8.1: your application has errors. waiting for file change

I am trying to create & rum meteor app on win 8.1 pc
what I done, I install meteor using official Meteor installer
I run following commands at desired path
meteor create myapp
this was ok
then cd myapp
this was also ok
but when I run command meteor to run the app, I got following result with error
[[[[[ ~\F\meteor\resolutions ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Errors prevented startup:
While loading plugin `compileTemplatesBatch` from packag
module.js:338:15: Cannot find module
'../modules/es6.object.get-own-property-descriptor'
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 Object.<anonymous> (C:\Users\Dinesh
Singh\AppData\Local\.meteor\packages\templating\1.1.7\pl
Batch.os\npm\node_modules\meteor\ecmascript-runtime\node_mo
pt-runtime\node_modules\meteor-ecmascript-runtime\node_modu
t.js:12:1)
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)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Users\Dinesh
Singh\AppData\Local\.meteor\packages\templating\1.1.7\pl
Batch.os\npm\node_modules\meteor\ecmascript-runtime\node_mo
pt-runtime\node_modules\meteor-ecmascript-runtime\server.js
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)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at npmRequire (C:\tools\isobuild\bundler.js:1665:14)
at Module.useNode (packages/modules-runtime.js:453:20)
at fileEvaluate (packages/modules-runtime.js:157:20)
at require (packages/modules-runtime.js:92:16)
at meteorInstall.node_modules.meteor.ecmascript-runtime.
(packages/ecmascript-runtime.js:24:18)
at fileEvaluate (packages/modules-runtime.js:158:9)
at require (packages/modules-runtime.js:92:16)
at packages/ecmascript-runtime.js:2832:15
at packages/ecmascript-runtime.js:2845:3
=> Your application has errors. Waiting for file change.
I search over the but didn't find specific result for windows.
As the latest version got this problem, use previous version to create a sample app like this,
meteor create --release 1.2.1 test-app
cd test-app
meteor
found on : https://github.com/meteor/meteor/issues/6609
Based on answers from this issue https://github.com/meteor/meteor/issues/6609 you need to :
Go to "C:\Users\username\AppData\Local.meteor\packages"
Move the packages causing the issue to another folder as you won't be able to delete them on windows due to long file names (templating, templating-tools, ecmascript, standard-minifier-css)
once the file deleted you can run "meteor npm install" then "meteor"
I have tested and it works for me.
I just removed all packages (withaout meteor) from AppData\Local.meteor\packages and run my app again. Meteor downloaded all packeges and now it is working.
The following fix worked for me:
Uninstall meteor from Windows (Programs and Features).
Install meteor (https://www.meteor.com/install)
Create a new Project (https://www.meteor.com/tutorials/blaze/creating-an-app)

Resources