Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11450] CLI: Scons fails if no write access to npm directory

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-10-13T20:50:50.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Release 3.1.0, 2012 Sprint 21 JS, 2012 Sprint 21
ComponentsCLI
Labelsn/a
ReporterChris Barber
AssigneeChris Barber
Created2012-10-13T02:15:48.000+0000
Updated2017-03-08T00:46:45.000+0000

Description

When scons runs npm, it will fail if it can't write to the npm directory. This might be caused if installing the Titanium CLI first using sudo which might write lock files to the real user's npm directory as root.
[ERROR] Failed to npm install dependencies

npm WARN package.json titanium-mobile-deps@3.1.0 No README.md file found!
npm ERR! Error: EACCES, open '/Users/vjoshi/.npm/463e1c03-async-0-1-x.lock'
npm ERR!  { [Error: EACCES, open '/Users/vjoshi/.npm/463e1c03-async-0-1-x.lock']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/vjoshi/.npm/463e1c03-async-0-1-x.lock' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/vjoshi/Documents/titanium_mobile/support
npm ERR! node -v v0.8.12
npm ERR! npm -v 1.1.63
npm ERR! path /Users/vjoshi/.npm/463e1c03-async-0-1-x.lock
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/vjoshi/.npm/463e1c03-async-0-1-x.lock'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/vjoshi/Documents/titanium_mobile/support/npm-debug.log
npm ERR! not ok code 0

scons: *** [dummy-sdk-target] Explicit exit, status 1
scons: building terminated because of errors.
This might be as simple as checking if the files are writeable and if not erroring.

Comments

  1. Chris Barber 2012-10-13

    Master pull request: https://github.com/appcelerator/titanium_mobile/pull/3204 3.0.x pull request: https://github.com/appcelerator/titanium_mobile/pull/3205
  2. Lee Morris 2017-03-08

    Closing ticket as resolved.

JSON Source