2

I am trying to install the wallet for IOTA, as described here. I run but the command is not found. I am not clear which package npm is in apt search npm where I do not find the corresponding application.

npm install -g electron

The application is in the package NodeJS here, and corresponding download is Linux Binaries (x86/x64) in the platfrom. Studying the download

masi@masi:~/Downloads/node-v8.9.1-linux-x64/node-v8.9.1-linux-x64/bin$ ./npm 
/usr/bin/env: ‘node’: No such file or directory
masi@masi:~/Downloads/node-v8.9.1-linux-x64/node-v8.9.1-linux-x64/bin$ ls -la
total 34384
drwxrwxr-x 2 masi masi     4096 Nov  7 22:56 .
drwxrwxr-x 6 masi masi     4096 Nov  7 22:56 ..
-rwxrwxr-x 1 masi masi 35198210 Nov  7 22:56 node
lrwxrwxrwx 1 masi masi       38 Dec  5 18:22 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxrwxrwx 1 masi masi       38 Dec  5 18:22 npx -> ../lib/node_modules/npm/bin/npx-cli.js

Almost working attempt, testing GAD3R

  1. Run

    sudo apt-get install -y build-essential
    curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
    sudo apt-get install -y nodejs
    

    You get notification ## Run apt-get install nodejs (as root) to install Node.js v8.x and npm`. But running it does no changes.

    A nodesource.list will be created under your /etc/apt/sources.list.d by the above commmands

     deb https://deb.nodesource.com/node_8.x stretch main
     deb-src https://deb.nodesource.com/node_8.x stretch main
    
  2. Run

     sudo npm install -g electron --unsafe-perm=true --allow-root
    

    Output

     + electron@1.7.9
     added 152 packages in 125.983s
    
  3. Change owners

     masi@masi:~/Downloads/wallet$ sudo chown -R masi:masi 
     /usr/lib/node_modules/
    
  4. Run

     sudo npm install -g bower
    

    Output

    npm WARN deprecated bower@1.8.2: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
    /usr/bin/bower -> /usr/lib/node_modules/bower/bin/bower
    + bower@1.8.2
    updated 1 package in 1.714s
    
  5. Test (here below Instructions heading)

    masi@masi:~/Downloads/wallet$ sudo npm start
    
    npm ERR! path /home/masi/package.json
    npm ERR! code ENOENT
    npm ERR! errno -2
    npm ERR! syscall open
    npm ERR! enoent ENOENT: no such file or directory, open '/home/masi/package.json'
    npm ERR! enoent This is related to npm not being able to find a file.
    npm ERR! enoent 
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/masi/.npm/_logs/2017-12-07T18_52_27_750Z-debug.log  
    

OS: Debian Stretch 9.1

5

To install Node.js and npm use the setup script (e.g: Nod.js V8):

sudo apt-get install -y build-essential
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

A nodesource.list will be created under your /etc/apt/sources.list.d with the following content :

deb https://deb.nodesource.com/node_8.x stretch main
deb-src https://deb.nodesource.com/node_8.x stretch main

Then install electron and brower:

npm install -g electron
npm install -g bower

Official website : Installing Node.js via package manager

Update

npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'

Fixing npm permissions

You may receive an EACCES error when you try to install a package globally. This indicates that you do not have permission to write to the directories that npm uses to store global packages and commands.

You can fix this problem using one of three options:

  1. Change the permission to npm's default directory.
  2. Change npm's default directory to another directory.
  3. Install Node with a package manager that takes care of this for you.

You should back-up your computer before moving forward.

A working solution on github : the ander7agar's comment tested on debian Stretch:

sudo npm install -g electron --unsafe-perm=true --allow-root

the same error will happen when installing brower , change the ownership of node_modules:

sudo chown -R masi:masi /usr/lib/node_modules
sudo npm install -g bower
  • 1
    @LéoLéopoldHertz준영 If the command exit without error , electron should be installed correctly . Type electron on the terminal to start the application. – GAD3R Dec 6 '17 at 10:39
  • 1
    @LéoLéopoldHertz준영 Install Node V8 then follow the instruction github.com/iotaledger/wallet#instructions , it will work for you ( maybe the problem come from the Node version it should be V8) – GAD3R Dec 6 '17 at 20:20
  • The setup script will automatically create a /etc/apt/sources.list.d/nodesource.list , i have installed electron , brower and start the IOTA wallet using npm start without problem (Node V8) – GAD3R Dec 7 '17 at 18:46
  • 1
    @LéoLéopoldHertz준영 run npm init then npm start – GAD3R Dec 7 '17 at 18:59
  • 1
    @LéoLéopoldHertz준영 the command npm install should install the dependencies , please run it under wallet after cloning iri – GAD3R Dec 7 '17 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.