3 Replies Latest reply on Dec 26, 2016 1:24 PM by Intel Corporation

    How to install ExpressJS and other libraries (for node.js)

    NewMech

      Hi guys,

      My board is already run opkg update.

      I have a problem with installing ExpressJS. First, I have some nodejs code that use Express module. So I installed the library on by system:

       

      root@edison:~# npm install express

       

      The installation seem to be good with no error. But when I run my project:

       

      root@edison:/media/sdcard/SocketIO-001# node main.js (my project folder is located on the sdcard)

       

      There is an error:  Cannot find module 'express'

       

      I think the problem is that I installed the module in the wrong place, so I change the directory to "/media/sdcard/SocketIO-001" and reinstall the module. But this time, there is a problem:

       

      root@edison:/media/sdcard/SocketIO-001# npm install express --save
      npm ERR! Linux 3.10.98-poky-edison+
      npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "express" "--save"
      npm ERR! node v4.4.3npm ERR! npm  v2.15.1npm ERR! path ../mime/cli.js
      npm ERR! code EPERMnpm ERR! errno -1npm ERR! syscall symlink
      npm ERR! Error: EPERM: operation not permitted, symlink '../mime/cli.js' -> '/media/sdcard/SocketIO-001/node_modules/express/node_modules/send/node_modules/.bin/mime'
      npm ERR!     at Error (native)
      npm ERR!  { [Error: EPERM: operation not permitted, symlink '../mime/cli.js' -> '/media/sdcard/SocketIO-001/node_modules/express/node_modules/send/node_modules/.bin/mime']
      npm ERR!   errno: -1,
      npm ERR!   code: 'EPERM',
      npm ERR!   syscall: 'symlink',

       

      npm ERR!   path: '../mime/cli.js',
      npm ERR!   dest: '/media/sdcard/SocketIO-001/node_modules/express/node_modules/send/node_modules/.bin/mime' }
      npm ERR!
      npm ERR! Please try running this command again as root/Administrator.

       

      npm ERR! Please include the following file with any support request:
      npm ERR!     /media/sdcard/SocketIO-001/npm-debug.log

       

       

      I got stuck now. Please help me. Thanks alot!