permissions wrong

710 views
Skip to first unread message

ghe...@me.com

unread,
Jul 7, 2017, 6:17:41 PM7/7/17
to Node-RED
there seems to be permissions problems with my installation
is it possible to fix them or do I need to start the whole thing from scratch?
I am running nr as user odroid (i think)

8 Jul 08:08:21 - [warn] Error: Command failed: npm install --save --save-prefix="~" --production node-red-...@2.4.2

npm WARN checkPermissions Missing write access to /home/odroid/.node-red/node_modules/node-red-dashboard/node_modules/serve-static

npm WARN checkPermissions Missing write access to /home/odroid/.node-red/node_modules/node-red-node-email/node_modules/imap

npm WARN checkPermissions Missing write access to /home/odroid/.node-red/node_modules/node-red-node-email/node_modules

npm WARN checkPermissions Missing write access to /home/odroid/.node-red/node_modules/node-red-dashboard/node_modules

npm WARN node-red...@0.0.1 No repository field.

npm WARN node-red...@0.0.1 No license field.

npm ERR! Linux 3.10.105-139

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "--save-prefix=\"~\"" "--production" "node-red-...@2.4.2"

npm ERR! node v6.11.0

npm ERR! npm  v3.10.10

npm ERR! path /home/odroid/.node-red/node_modules/node-red-dashboard/node_modules/serve-static

npm ERR! code EACCES

npm ERR! errno -13

npm ERR! syscall access


npm ERR! Error: EACCES: permission denied, access '/home/odroid/.node-red/node_modules/node-red-dashboard/node_modules/serve-static'

npm ERR!     at Error (native)

npm ERR!  { Error: EACCES: permission denied, access '/home/odroid/.node-red/node_modules/node-red-dashboard/node_modules/serve-static'

npm ERR!     at Error (native)

npm ERR!   errno: -13,

npm ERR!   code: 'EACCES',

npm ERR!   syscall: 'access',

npm ERR!   path: '/home/odroid/.node-red/node_modules/node-red-dashboard/node_modules/serve-static' }

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!     /home/odroid/.node-red/npm-debug.log


odroid@odroid:~/.node-red$ ls -la

total 336

drwxr-xr-x   4 odroid odroid   4096 Jul  8 08:08 .

drwxr-xr-x  27 odroid odroid   4096 Jul  8 08:06 ..

-rw-r--r--   1 odroid odroid  22744 Jul  3 18:51 .config.json

-rw-rw-r--   1 odroid odroid    256 Jun 23 20:14 flows_odroid_cred.json

-rw-rw-r--   1 odroid odroid    332 Jun 22 19:34 .flows_odroid_cred.json.backup

-rw-rw-r--   1 odroid odroid  21932 Jul  4 09:23 flows_odroid.json

-rw-rw-r--   1 odroid odroid  21950 Jul  4 09:19 .flows_odroid.json.backup

drwxr-xr-x   3 odroid odroid   4096 Nov 30  2016 lib

drwxr-xr-x 268 odroid odroid  12288 Jun 23 19:57 node_modules

-rw-rw-r--   1 odroid odroid 222285 Jul  8 08:08 npm-debug.log

-rw-rw-r--   1 odroid odroid     99 Jul  3 18:50 package.json

-rw-r--r--   1 odroid odroid   8091 Nov 30  2016 settings.js


Mukhtar Amin

unread,
Jul 7, 2017, 7:33:06 PM7/7/17
to Node-RED
Hi, I think I am getting similar error when trying to install node-red-dashboard.
I am using Armbian 5.31 on Orange Pi Zero.

pi@orangepizero:~$ cd .node-red
pi@orangepizero:~/.node-red$ npm install node-red-dashboard
npm WARN package.json node-red...@0.0.1 No repository field.
npm WARN package.json node-red...@0.0.1 No README data
npm WARN package.json node-red...@0.0.1 No license field.
npm ERR! tar.unpack untar error /home/pi/.npm/node-red-dashboard/2.4.2/package.tgz
npm ERR! Linux 3.4.113-sun8i
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-red-dashboard"
npm ERR! node v4.8.3
npm ERR! npm  v2.15.11
npm ERR! path /home/pi/.node-red/node_modules/node-red-dashboard

npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/home/pi/.node-red/node_modules/node-red-dashboard'

npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, mkdir '/home/pi/.node-red/node_modules/node-red-dashboard']

npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/home/pi/.node-red/node_modules/node-red-dashboard',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/home/pi/.node-red/node_modules/node-red-dashboard',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack:
npm ERR!    [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR!      '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR!      'FSReqWrap.oncomplete (fs.js:82:15)' ] }

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!     /home/pi/.node-red/npm-debug.log

Installing on palette manager gave errors too.

7 Jul 23:27:08 - [info] Installing module: node-red-dashboard, version: 2.4.2
7 Jul 23:27:18 - [warn] Installation of module node-red-dashboard failed:
7 Jul 23:27:18 - [warn] ------------------------------------------
7 Jul 23:27:18 - [warn] Error: Command failed: npm install --save --save-prefix="~" --production node-red-...@2.4.2
npm WARN package.json node-red...@0.0.1 No repository field.
npm WARN package.json node-red...@0.0.1 No README data
npm WARN package.json node-red...@0.0.1 No license field.
npm ERR! Linux 3.4.113-sun8i

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "--save-prefix=\"~\"" "--production" "node-red-...@2.4.2"
npm ERR! node v4.8.3
npm ERR! npm  v2.15.11
npm ERR! file /home/pi/.npm/serve-static/1.12.3/package/package.json
npm ERR! code EJSONPARSE

npm ERR! Failed to parse json
npm ERR! Unexpected end of input at 82:12
npm ERR!     "tarbal
npm ERR!            ^
npm ERR! File: /home/pi/.npm/serve-static/1.12.3/package/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse


npm ERR! Please include the following file with any support request:
npm ERR!     /home/pi/.node-red/npm-debug.log

7 Jul 23:27:18 - [warn] ------------------------------------------

I attach npm-debug.log here. Any help would be appreciated, thank you.

npm-debug.log

Bobo

unread,
Jul 8, 2017, 2:15:20 AM7/8/17
to Node-RED
I am a total noob at this, but isn't the key line in your log ...


npm ERR! Please try running this command again as root/Administrator.

Tried SUDO?

Julian Knight

unread,
Jul 8, 2017, 3:45:09 AM7/8/17
to Node-RED
That isn't a good idea as it only tends to make the problem worse not better. As has been said many times in this forum, you shouldn't install npm modules as root unless installing them globally and it is really best to avoid that as much as possible.

In these cases, you need to, from a command line, run "ls -l /home/pi/.node-red/node_modules/node-red-dashboard" and show us who owns that folder, probably root.

To fix, you can probably do:

sudo chown -r odroid:odroid /home/pi/.node-red/node_modules/node-red-dashboard

Most likely you did a "sudo npm install node-red-dashboard" or similar. That leaves dashboard installed as root.

ghe...@me.com

unread,
Jul 8, 2017, 4:47:30 AM7/8/17
to Node-RED
here is the result

odroid@odroid:~$ ls -l /home/odroid/.node-red/node_modules/node-red-dashboard

total 72

-rw-r--r-- 1 odroid odroid 10803 May 24 02:12 CHANGELOG.md

-rw-r--r-- 1 odroid odroid  2593 Feb 10 06:09 CONTRIBUTING.md

drwxr-xr-x 5 odroid odroid  4096 Jun 23 19:57 dist

-rwxr-xr-x 1 odroid odroid   593 May  8 02:35 fixfa.js

-rw-r--r-- 1 odroid odroid   655 Feb 10 06:09 LICENSE

-rw-r--r-- 1 odroid odroid   944 Feb 10 06:09 license.js

drwxr-xr-x 3 root   root    4096 Jun 23 19:57 node_modules

drwxr-xr-x 3 odroid odroid  4096 Jun 23 19:57 nodes

-rw-r--r-- 1 odroid odroid  4811 Jun 23 19:57 package.json

-rw-r--r-- 1 odroid odroid  7528 May 16 23:31 README.md

-rw-r--r-- 1 odroid odroid 15499 May 22 17:48 ui.js

Zenofmud

unread,
Jul 8, 2017, 6:26:36 AM7/8/17
to node...@googlegroups.com
@ghendo - Looks like you somehow did a npm install while in the node-red-dashboard directory! See the ‘node-modules’ and ‘node’ folders - they shouldn’t be there (I’ve done dumb things like this myself, normally I do an install but neglect to get into the .node-red directory first). If you do a 
ls -l /home/odroid/.node-red/node_modules/node-red-dashboard/node_modules
You will see what you installed there. 

Once you have the contents of that node_module directory, I would do a ‘npm remove xxxx’ or ‘sudo npm remove xxx’ depending on the owner of the files in that directory

You might want to see if Julian will weigh in on this advice...

-- 
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
--- 
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/542bd8ec-4962-493c-8b7f-f1c56fd390c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ghe...@me.com

unread,
Jul 8, 2017, 6:31:32 AM7/8/17
to Node-RED
here is result ls -l /home/odroid/.node-red/node_modules/node-red-dashboard/node_modules

odroid@odroid:~$ ls -l /home/odroid/.node-red/node_modules/node-red-dashboard/node_modules

total 4

drwxr-xr-x 3 root root 4096 Jun 23 19:57 serve-static

Dave C-J

unread,
Jul 8, 2017, 7:24:02 AM7/8/17
to node...@googlegroups.com
as already mentioned it's the root permissions giving you the problem. The command Julian gave should fix it (though it should be a -R (caps) I think 
  sudo chown -R odroid:odroid /home/odroid/.node-red/node_modules

 then re-run the install

   cd ~/.node-red && npm i node-red-dashboard

Julian Knight

unread,
Jul 8, 2017, 7:44:34 AM7/8/17
to Node-RED
And this is what the folder should look like:

pi@pi2 ~/node/nrlive/node_modules/node-red-dashboard
$ ll
total
84K
-rw-r--r-- 1 pi pi  12K Jul  7 15:05 CHANGELOG.md
-rw-r--r-- 1 pi pi 2.6K Feb  9 19:09 CONTRIBUTING.md
drwxr
-xr-x 5 pi pi 4.0K Jul  8 11:28 dist/
-rwxr-xr-x 1 pi pi  593 May  7 17:35 fixfa.js*
-rw-r--r-- 1 pi pi  989 May  7 17:35 .jscsrc
-rw-r--r-- 1 pi pi   20 Nov 21  2016 .jshintignore
-rw-r--r-- 1 pi pi  856 Jun 22 23:30 .jshintrc
-rw-r--r-- 1 pi pi  655 Feb  9 19:09 LICENSE
-rw-r--r-- 1 pi pi  944 Feb  9 19:09 license.js
drwxr
-xr-x 3 pi pi 4.0K Jul  8 11:28 nodes/
-rw-r--r-- 1 pi pi 4.8K Jul  8 11:28 package.json
-rw-r--r-- 1 pi pi 7.2K Jun 29 10:04 README.md
-rw-r--r-- 1 pi pi  17K Jun 30 16:46 ui.js

Note that there is no node_modules folder in there and, as Paul said, there shouldn't be. You can just delete it (as sudo as it is owned by root). If you want to serve static files, Node-RED already has that capability, have a look at your settings.js.

Dave C-J

unread,
Jul 8, 2017, 8:37:15 AM7/8/17
to node...@googlegroups.com
Julian

err - no it shouldn't - he's running on an odroid as an odroid user so it won't look like that

ghe...@me.com

unread,
Jul 8, 2017, 4:18:34 PM7/8/17
to Node-RED

Seems like fixed now

Thanks for your help

Perhaps a button "check and repair permissions" would be a nice touch 

Julian Knight

unread,
Jul 9, 2017, 11:28:41 AM7/9/17
to Node-RED
I did figure he could work out the difference ;)
Reply all
Reply to author
Forward
0 new messages