EACCES exception when using cordova or framework7-cli npm commands


(Kakol) #1

I’ve been having a problem with any programs that use npm to perform installs or uninstalls recently, cordova and framework7-cli will fail when trying to install dependencies via npm due to an EACCES error on npm’s part.

The debug logs npm gives are not very helpful and although the do provide me with an EACCES error, there’s no given directory or file that npm was working on when the exception occurred. The folders and files are all owned by my user so I don’t understand how npm could encounter an error like this and since no path is given I can’t test anything out myself. In case this is a known issue and I’ve just not found out, I’m using the snap version of node 11/stable channel available from nodesource

Versions
$ node -v
v11.10.0
$ npm -v
6.8.0
Shortened debug.log
// "npm install framework7 dom7 template7 framework7-icons --save" ran under "framework7-cli"
199 verbose cwd ~/Project
200 verbose Linux 4.15.0-45-generic
201 verbose argv "/snap/node/1684/bin/node" "~/.npm/bin/npm" "install" "framework7" "dom7" "template7" "framework7-icons" "--save"
202 verbose node v11.10.0
203 verbose npm  v6.8.0
204 error code EACCES
205 error errno -13
206 error syscall write
207 error Error: EACCES: permission denied, write
207 error     at writeSync (fs.js:589:3)
207 error     at SyncWriteStream._write (internal/fs/sync_write_stream.js:22:3)
207 error     at doWrite (_stream_writable.js:415:12)
207 error     at writeOrBuffer (_stream_writable.js:399:5)
207 error     at SyncWriteStream.Writable.write (_stream_writable.js:299:11)
207 error     at EventEmitter.log.write (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:271:10)
207 error     at EventEmitter.<anonymous> (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:234:12)
207 error     at Array.forEach (<anonymous>)
207 error     at EventEmitter.log.emitLog (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:232:28)
207 error     at EventEmitter.<anonymous> (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:214:8)
207 error     at EventEmitter.<anonymous> (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:286:23)
207 error     at shouldPrependCurrentNodeDirToPATH (~/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:181:18)
207 error     at lifecycle_ (~/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:118:7)
207 error     at ~/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:90:9
207 error     at ~/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:203:12
207 error     at ~/.npm/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:285:20
207 error  { Error: EACCES: permission denied, write
207 error     at writeSync (fs.js:589:3)
207 error     at SyncWriteStream._write (internal/fs/sync_write_stream.js:22:3)
207 error     at doWrite (_stream_writable.js:415:12)
207 error     at writeOrBuffer (_stream_writable.js:399:5)
207 error     at SyncWriteStream.Writable.write (_stream_writable.js:299:11)
207 error     at EventEmitter.log.write (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:271:10)
207 error     at EventEmitter.<anonymous> (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:234:12)
207 error     at Array.forEach (<anonymous>)
207 error     at EventEmitter.log.emitLog (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:232:28)
207 error     at EventEmitter.<anonymous> (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:214:8)
207 error     at EventEmitter.<anonymous> (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:286:23)
207 error     at shouldPrependCurrentNodeDirToPATH (~/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:181:18)
207 error     at lifecycle_ (~/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:118:7)
207 error     at ~/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:90:9
207 error     at ~/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:203:12
207 error     at ~/.npm/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:285:20
207 error   stack:
207 error    'Error: EACCES: permission denied, write\n    at writeSync (fs.js:589:3)\n    at SyncWriteStream._write (internal/fs/sync_write_stream.js:22:3)\n    at doWrite (_stream_writable.js:415:12)\n    at writeOrBuffer (_stream_writable.js:399:5)\n    at SyncWriteStream.Writable.write (_stream_writable.js:299:11)\n    at EventEmitter.log.write (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:271:10)\n    at EventEmitter.<anonymous> (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:234:12)\n    at Array.forEach (<anonymous>)\n    at EventEmitter.log.emitLog (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:232:28)\n    at EventEmitter.<anonymous> (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:214:8)\n    at EventEmitter.<anonymous> (~/.npm/lib/node_modules/npm/node_modules/npmlog/log.js:286:23)\n    at shouldPrependCurrentNodeDirToPATH (~/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:181:18)\n    at lifecycle_ (~/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:118:7)\n    at ~/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:90:9\n    at ~/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:203:12\n    at ~/.npm/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:285:20',
207 error   errno: -13,
207 error   syscall: 'write',
207 error   code: 'EACCES' }
208 error The operation was rejected by your operating system.
208 error It is likely you do not have the permissions to access this file as the current user
208 error
208 error If you believe this might be a permissions issue, please double-check the
208 error permissions of the file and its containing directories, or try running
208 error the command again as root/Administrator (though this is not recommended).
209 verbose exit [ -13, true ]
Issues on GitHub

https://github.com/framework7io/framework7-cli/issues/14#issuecomment-465790005
https://github.com/apache/cordova-lib/issues/747

Any help would be appreciated


(Kakol) #2

As an update, it appears to be snap that causes the problem. Bit disappointing that I’m forced to use the package instead of the snap though


(system) closed #3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.