Cannot install electron in Ubuntu - javascript

My npm version is 3.10.10
And node version is v7.2.1
And when I tried to install electron in ubuntu via :
sudo npm install electron --save-dev
I get error like this :
Error: read ECONNRESET
at exports._errnoException (util.js:1022:11)
at TLSWrap.onread (net.js:572:26)
npm WARN enoent ENOENT: no such file or directory, open '/home/dotmark/package.json'
npm WARN dotmark No description
npm WARN dotmark No repository field.
npm WARN dotmark No README data
npm WARN dotmark No license field.
npm ERR! Linux 3.13.0-87-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "electron" "--save-dev"
npm ERR! node v7.2.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! electron#1.4.13 postinstall: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#1.4.13 postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/dotmark/npm-debug.log

You can't add a module to the dependencies of the package you are writing (--save-dev) unless you first create a package (with npm init or by manually writing a package.json).
… but don't make the root of your package your own home directory. Create a directory for it.

Related

I have this error message "npm ERR! Linux 5.4.72-microsoft-standard-WSL2" on my terminal when I run "npm install"

I have this error message : npm ERR! Linux 5.4.72-microsoft-standard-WSL2 on my terminal when I run npm install. I'm on a vue.js app and I have this message since I installed vuetify.
Here is the whole error message :
npm ERR! Linux 5.4.72-microsoft-standard-WSL2
npm ERR! argv "/home/josephine/.nvm/versions/node/v14.15.0/bin/node" "/home/josephine/.nvm/versions/node/v14.15.0/bin/npm" "install"
npm ERR! node v14.15.0
npm ERR! npm v3.10.10
npm ERR! cb.apply is not a function.
I also cannot install the latest version of npm I think this is related to the problem. (I have this version v3.10.10).
And when I run npm run serve I have this :
> vue-cli-service serve
sh: 1: vue-cli-service: not found
npm ERR! Linux 5.4.72-microsoft-standard-WSL2
npm ERR! argv "/home/josephine/.nvm/versions/node/v14.15.0/bin/node" "/home/josephine/.nvm/versions/node/v14.15.0/bin/npm" "run" "serve"
npm ERR! node v14.15.0
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! my-app#0.1.0 serve: vue-cli-service serve
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the my-app#0.1.0 serve script 'vue-cli-service serve'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the my-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! vue-cli-service serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs my-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls my-app
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?`.
I have the Vue.JS version # vue / cli 4.5.12.
At last, I have a Window PC and I have installed linux and ubuntu.
I thank you in advance if you can help me.
Your npm version is outdated. Your version is 3.x but we're currently at 7.x
Run
npm update -g
and then try again.

Installing Spectron

I try to install Spectron, by using this command:
npm install --save-dev spectron
but I get this Err msg:
npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program
Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "install" "--save-dev" "spectron"
npm ERR! node v6.9.2 npm ERR! npm v3.10.9 npm ERR! code ENOSELF
npm ERR! Refusing to install spectron as a dependency of itself npm
ERR! npm ERR! If you need help, you may report this error at: npm ERR!
https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! C:\spectron-master\npm-debug.log
What i'm doing wrong?
If you don't set any name in the package.json by default the folder name is taken.
You can't install a Package which is same like the name in package.json.
example : trying to install Spectron in a project having the name Spectron in package.json is supposed to raise this error.

Command 'export' not recognized after 'npm run build' with webpack

We want to use webpack in our project. It has already been partly integrated as a test on a Mac and it works.
When using the same branch on my Windows machine I get following error message.
Webpack version ist 1.12.15
The part in German means that command 'export' could not be recognized or was not written correctly.
S:\project>npm run build
> project#version build S:\project
> export NODE_ENV=dev && webpack
Der Befehl "export" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\someone\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v4.4.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! project#version build: `export NODE_ENV=dev && webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project#version build script 'export NODE_ENV=dev && webpack'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the onedata package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! export NODE_ENV=dev && webpack
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs project
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls project
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! S:\project\npm-debug.log
It is not possible to use the newest node.js, as some other packages are incompatible to it.

Can't install babel-cli

I'm getting an error when trying to run:
$babel-node ./server.js
The CLI has been moved into the package babel-cli.
$ npm install -g babel-cli
When I install it and run it again it asks again for it.
Anyone came across this situation? Can't seem to move forward.
>
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v5.1.0
npm ERR! npm v3.5.0
npm ERR! code ELIFECYCLE
npm ERR! relay-starter-kit#0.1.0 start: `babel-node ./server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the relay-starter-kit#0.1.0 start script 'babel-node ./server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the relay-starter-kit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! babel-node ./server.js
npm ERR! You can get their info via:
npm ERR! npm owner ls relay-starter-kit
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/diogo/Projects/cf-ophite/npm-debug.log
Babel Version 6 split some packages.
Did you try to open a new terminal window after
npm install -g babel-cli ?
You can also install version 5 and work as before:
npm install -g babel#5
If this happens after upgrading node, try npm rebuild in your project directory
Another solution is to delete the node_modules folder, and execute npm install again

Global installation of grunt.js fails

I could install gruntjs locally using npm install grunt.
But when I'm trying to install it globally npm install grunt -g, i'm getting an error:
npm ERR! Error: EACCES, symlink '../lib/node_modules/grunt/bin/grunt'
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR!
npm ERR! System Linux 2.6.18-92.el5xen
npm ERR! command "nodejs" "/usr/bin/npm" "install" "grunt" "-g"
npm ERR! cwd /home/lj
npm ERR! node -v v0.6.18
npm ERR! npm -v 1.1.19
npm ERR! path ../lib/node_modules/grunt/bin/grunt
npm ERR! code EACCES
npm ERR! message EACCES, symlink '../lib/node_modules/grunt/bin/grunt'
npm ERR! errno {}
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR!
npm ERR! System Linux 2.6.18-92.el5xen
npm ERR! command "nodejs" "/usr/bin/npm" "install" "grunt" "-g"
npm ERR! cwd /home/lj
npm ERR! node -v v0.6.18
npm ERR! npm -v 1.1.19
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! message EACCES, open 'npm-debug.log'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/lj/npm-debug.log
npm not ok
With sudo I have error too:
npm ERR! Error: spawn ENOENT
npm ERR! at errnoException (child_process.js:483:11)
npm ERR! at ChildProcess.spawn (child_process.js:446:11)
npm ERR! at child_process.js:342:9
npm ERR! at Object.execFile (child_process.js:252:15)
npm ERR! at uidNumber (/usr/lib/nodejs/uid-number/uid-number.js:33:17)
npm ERR! at loadUid (/usr/lib/nodejs/npm/lib/npm.js:336:5)
npm ERR! at Array.2 (/usr/lib/nodejs/bind-actor.js:15:8)
npm ERR! at LOOP (/usr/lib/nodejs/chain.js:15:13)
npm ERR! at /usr/lib/nodejs/chain.js:18:7
npm ERR! at setUser (/usr/lib/nodejs/npm/lib/npm.js:346:32)
npm ERR! 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!
npm ERR! System Linux 2.6.18-92.el5xen
npm ERR! command "nodejs" "/usr/bin/npm" "install" "grunt" "-g"
npm ERR! cwd /home/lj
npm ERR! node -v v0.6.18
npm ERR! npm -v 1.1.19
npm ERR! syscall spawn
npm ERR! code ENOENT
npm ERR! message spawn ENOENT
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/lj/npm-debug.log
npm not ok
What could I do to install it?
P.S. It's possible that come rights for some folders is for root:root, not for my user. Cuz our admins installed VM that way...
I've had this problem too with grunt and bower
The solution I've found is in this article NPM config
In your .npmrc you need to set the prefix path
prefix = /usr/local
or you can do it from terminal like this:
npm config set prefix "/usr/local"
This way node will know where to install them:
In npm 1.0, there are two ways to install things:
globally —- This drops modules in {prefix}/lib/node_modules, and puts executable files in {prefix}/bin, where {prefix} is usually something like /usr/local. It also installs man pages in {prefix}/share/man, if they’re supplied.
locally —- This installs your package in the current working directory. Node modules go in ./node_modules, executables go in ./node_modules/.bin/, and man pages aren’t installed at all.
Try chowning the node_modules folder and then try to install again:
sudo chown -R $USER /path/to/node_modules/folder
Encountered same issue. The following works for me:
sudo npm install -g grunt-cli
try sudo npm install -g grunt ?
Adding the option --no-bin-links works good. I tried everything and only this solved my problem. I was installing the Yeoman on ubuntu 12.04 and it was always returning the error:
npm ERR! Error: EACCES, symlink '../lib/node_modules/yo/cli.js'
Then, I did:
npm install -g --no-bin-links yo
=D
For more details https://github.com/isaacs/npm/issues/2380

Categories