Installing 2.7 with npm gives me errors

In order to convert my app from 2.5 to 2.7, I wanted to get started with enyo 2.7 (no, I'm not an early adopter...).
So on both my Ubuntu's (one 14.04, other 16.04), I have nodejs (version 7.3.0, but I have tried 6.x and 5.x as well).
Now the first step from the Getting Started instructions
sudo npm install -g enyo-dev
gives me the error below (running without 'sudo' gives me the error that it cannot write to '/usr/lib/node_modules')
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: Deprecated, use jstransformer
/usr/bin/enyo -> /usr/lib/node_modules/enyo-dev/bin/enyo.js

> [email protected] install /usr/lib/node_modules/enyo-dev/node_modules/dtrace-provider
> node scripts/install.js

> [email protected] postinstall /usr/lib/node_modules/enyo-dev
> node ./bin/upgrade.js

  return, stringToFlags(flags), mode);

Error: EACCES: permission denied, open '/home/david/.babel.json'
    at Object.fs.openSync (fs.js:557:18)
    at Object.fs.writeFileSync (fs.js:1222:33)
    at save (/usr/lib/node_modules/enyo-dev/node_modules/babel-register/lib/cache.js:45:16)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:607:11)
    at run (bootstrap_node.js:420:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:535:3
└── (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules/enyo-dev/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 3.13.0-106-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "enyo-dev"
npm ERR! node v7.3.0
npm ERR! npm  v3.10.10

npm ERR! [email protected] postinstall: `node ./bin/upgrade.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script 'node ./bin/upgrade.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the enyo-dev package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/upgrade.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs enyo-dev
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls enyo-dev
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/david/npm-debug.log
npm ERR! code 1
I noticed this discussion, but it doesn't give an answer how to resolve the issue (on Linux):

If you want to explain me something related to nodejs and npm, please be aware that I hardly know anything about those two... ;-)


  • Do you perhaps have a .babel.json file that was created by something else? and/or left somehow in a bad access mode?
  • edited January 2017
    Thanks for helping me! But I have a clean nodejs installation, I haven't done much with it, except for trying some very basic Javascript lines in the shell.
    I don't actually have any .babel.json file in my home directory. I don't see it appearing either, during the few seconds of installing enyo-dev. I do have (of course) normal reading and writing access to my own home directory.

    Do I need to do something first to get this .babel.json file in place, before install enyo-dev? I thought npm was taking care of that kind of dependencies...? (but then again, I hardly have any experience there)
  • Just a quick note that I've reproduced this on a fresh install of Ubuntu 16.04 in VirtualBox. Will do some further digging to try to isolate what's happening.
  • Creating an empty .babel.json file and reinstalling succeeded but doesn't explain why it failed in the first place.
  • sudo BABEL_DISABLE_CACHE=1 npm install -g enyo-dev also works
  • Thank you so much for getting back to this! I now tried to create an empty .babel.json file in the Documents folder, and then doing the 'First Steps' from the getting started guide. That works for me. It is not really the way it should, but at least I can continue now. I hope other developers on Ubuntu will find this information useful as well. Please leave a comment if this ever get fixed :-)
  • Aye, searching google for +"EACCESS" +".babel.json" leads to several answers that involve pointing the cache to a particular place (ie /tmp which is usually world writeable), or disabling the cache. I don't see any explanation as to *why* it would do this, does babel somehow run as a different user id? I could see it creating a file with a permission using sudo, but you can't get to it when you run as your normal user account.. but the indication from MrPleasant was that there was no file there, rather than a file that wasn't accessible.

    Seems that some step in installing or running babel is at fault, but not exactly clear what that is.
Sign In or Register to comment.