Picture of Scott L
adapt-cli installation failure (Win7, Node 7.9.0)
by Scott L - Thursday, 20 April 2017, 10:11 PM
 

After some struggling with the CLI install back in early March during my first exploration with Adapt, I’d manage to get adapt-cli installed (I couldn’t get it installed with a Node 6.10 LTS version of Node, but did with a 7.x Current version of Node). I was able to successfully created a course and play around with it briefly during my new getting acquainted phase.

I haven’t done anything with it until now, fast forward several weeks and a couple of Node updates, and I tried creating a course again and I got errors. I figured I’d uninstalled adapt-cli and this is where a new install is failing.

Here is all CLI activity starting with npm install… Any suggestions (including how to ask this question in a batter way) ?

 

$ npm install -g adapt-cli

E:\Users\Scott2\AppData\Roaming\npm\adapt -> E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\bin\adapt

> nodegit@0.16.0 install E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\nodegit
> node lifecycleScripts/preinstall && node lifecycleScripts/install

[nodegit] Running pre-install script
[nodegit] Running install script
node-pre-gyp
ERR! Tried to download(403): https://nodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.16.0-node-v51-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for nodegit@0.16.0 and node@7.9.0 (node-v51 ABI) (falling back to source compile with node-gyp)
gyp

ERR! configure error

gyp
ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\node-gyp\lib\configure.js:482:19)
gyp ERR! stack
at PythonFinder.<anonymous> (E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR!
stack at E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR!
stack at FSReqWrap.oncomplete (fs.js:114:15)
gyp
ERR! System Windows_NT 6.1.7601
gyp
ERR! command
"C:\\Program Files\\nodejs\\node.exe" "E:\\Users\\Scott2\\AppData\\Roaming\\npm\\node_modules\\adapt-cli\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=E:\\Users\\Scott2\\AppData\\Roaming\\npm\\node_modules\\adapt-cli\\node_modules\\nodegit\\build\\Release\\nodegit.node" "--module_name=nodegit" "--module_path=E:\\Users\\Scott2\\AppData\\Roaming\\npm\\node_modules\\adapt-cli\\node_modules\\nodegit\\build\\Release"
gyp
ERR! cwd E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\nodegit
gyp ERR!
node -v v7.9.0
gyp
ERR!
node-gyp -v v3.6.0
gyp ERR!
not ok
node-pre-gyp
ERR! build error
node-pre-gyp
ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\nodegit\build\Release\nodegit.node --module_name=nodegit --module_path=E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\nodegit\build\Release' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack
at ChildProcess.emit (events.js:194:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:899:16)
node-pre-gyp ERR!
stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\Users\\Scott2\\AppData\\Roaming\\npm\\node_modules\\adapt-cli\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR!
cwd E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\nodegit
node-pre-gyp
ERR! node -v
v7.9.0
node-pre-gyp
ERR! node-pre-gyp -v
v0.6.34
node-pre-gyp
ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\nodegit\build\Release\nodegit.node --module_name=nodegit --module_path=E:\Users\Scott2\AppData\Roaming\npm\node_modules\adapt-cli\node_modules\nodegit\build\Release' (1)
[nodegit] ERROR - Could not finish install
[nodegit] ERROR - finished with error code: 1
E:\Users\Scott2\AppData\Roaming\npm
`-- (empty)

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "adapt-cli"
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! nodegit@0.16.0 install: `node lifecycleScripts/preinstall && node lifecycleScripts/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodegit@0.16.0 install script 'node lifecycleScripts/preinstall && node lifecycleScripts/install'.
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 nodegit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node lifecycleScripts/preinstall && node lifecycleScripts/install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs nodegit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls nodegit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! E:\Users\Scott2\AppData\Roaming\npm-cache\_logs\2017-04-20T21_49_24_790Z-debug.log

Picture of Matt Leathes
Re: adapt-cli installation failure (Win7, Node 7.9.0)
by Matt Leathes - Friday, 21 April 2017, 12:01 AM
 

Have you tried with an older version of Node? I've definitely got it working with both 4.3.1 and 6.9.4

Keeping up with Current version is a bit more of a task than we have time for but we should be compatible with the LTS version...

It is worth noting that you don't need the adapt-cli, it just provides some convenience for downloading the framework and plugins. You just download the framework itself from github then create the following subfolders in src:

  • components
  • extensions
  • menu
  • theme

And you download any plugins you want to use into there prior to running $ npm install

Or you could use adapt-setup which has a nice select-which-plugins-you-want feature. the setup it creates, however, assumes you're going to be using the RUB build tool instead of Grunt so has a slightly different structure - but it's easy enough to change it back if you do want to use Grunt instead.

Picture of Scott L
Re: adapt-cli installation failure (Win7, Node 7.9.0)
by Scott L - Friday, 21 April 2017, 1:53 PM
 

Hello Matt, thanks for the clarification and reminder here - much appreciated!

I don't use nvm to manage multiple versions of node, but I did uninstall 7.9.0 and then installed the LTS 6.9.4, and afterwards was able to successfully install the adapt-cli. Nonetheless, I'm glad to be more aware of the multiple options.

What kinds of things does the team have to do to stay compatible with more recent versions of LTS (latest being 6.10.2)?

Picture of Matt Leathes
Re: adapt-cli installation failure (Win7, Node 7.9.0)
by Matt Leathes - Friday, 21 April 2017, 3:08 PM
 

it's just a case of testing the install really, it just gets overlooked because once you have adapt-cli installed you don't need to do it again!

Also it needs a LOT of cross-platform testing... and debugging what has gone wrong when it does fail is not easy.

I'm slightly surprised that a version bump on LTS would have broken it...

Picture of Scott L
Re: adapt-cli installation failure (Win7, Node 7.9.0)
by Scott L - Friday, 21 April 2017, 4:11 PM
 

I was partially thinking about clients and the like, who might end up doing some eLearning with Adapt, and wanted to know the whole setup scenario and potential barriers they might encounter.

Thanks for this info, Matt. Yeah, that must be a lot of testing & debugging...

I did run across an issue when doing the simple "download from Github" approach (which is probably what I'd use with teams if we decided to do some things with Adapt). Following your instructions above, I created the four subdirectories in 'src', then in the main folder I ran $ npm install. No problems there. Then $ grunt build - no problem. But when running $ grunt server, even though it did open my browser and show http://localhost:9001/, the page was stuck on showing "Loading...". This was totally unstyled, in the upper-left. Any idea on what is missing? Some other initial step, perhaps?

Picture of Matt Leathes
Re: adapt-cli installation failure (Win7, Node 7.9.0)
by Matt Leathes - Friday, 21 April 2017, 5:31 PM
 
wanted to know the whole setup scenario and potential barriers they might encounter

One other barrier which we haven't really solved yet is that if you're behind a corporate firewall/proxy, the installation process can be a major headache as the firewall/proxy will block so much... search the forums, there's a few posts about this and an issue here.

Following your instructions above, I created the four subdirectories in 'src', then in the main folder I ran $ npm install. No problems there. Then $ grunt build - no problem. But when running $ grunt server, even though it did open my browser and show http://localhost:9001/, the page was stuck on showing "Loading...". This was totally unstyled, in the upper-left. Any idea on what is missing? Some other initial step, perhaps?

Sounds like you missed out the step 'download any plugins you want to use into there prior to running $ npm install'

For reference, these are the extensions, components, menu & theme that the adapt-cli would create in these folders:

screenshot of the default adapt install

 

Picture of Scott L
Re: adapt-cli installation failure (Win7, Node 7.9.0)
by Scott L - Friday, 21 April 2017, 9:11 PM
 

You're right, Matt. I was aware of the step, but didn't fully realize until your response that it was a "need to do" not a "can do if you want to".

What's the most efficient way to download these items? Is there perhaps a lengthy npm install or git clone command that one could copy? Or would one typically do this one-by-one?

Picture of Sam Tsiu
Re: adapt-cli installation failure (Win7, Node 7.9.0)
by Sam Tsiu - Saturday, 22 April 2017, 4:33 AM
 

Hi Scott,

To install the plugins manually, you just run the command adapt install

It will install all the plugins listed in the adapt.json file.

Please note that you need to have the adapt-cli installed globally to do the adapt install

Picture of Scott L
Re: adapt-cli installation failure (Win7, Node 7.9.0)
by Scott L - Saturday, 22 April 2017, 2:44 PM
 

Thanks, Sam. I see the CLI documentation does mention that, too. Part of my reason for asking was if I, or somebody I'm working with, didn't or couldn't install the adapt-cli (I previously had troubles getting it to install). Knowing that adapt-cli is only one option for creating a course and getting started (As Matt mentioned to me above, it isn't needed), I was wondering how one goes about getting these default plugins without adapt-cli.

I do have it installed currently on one of my PCs, and adapt install worked just fine.

This might be an odd question, but when working with others I'd expect them to run into problems, especially when they're less Node-oriented than myself.

Picture of Matt Leathes
Re: adapt-cli installation failure (Win7, Node 7.9.0)
by Matt Leathes - Saturday, 22 April 2017, 2:27 PM
 

Unfortunately if you don't have the adapt-cli installed you'll have to do it manually... either by downloading or but git-cloning each plugin into the appropriate subfolder. or use something like adapt-setup.

Or if you've managed to get adapt-cli installed on computer 'a' but not computer 'b' you can just copy everything (bar the node_modules folder) from computer 'a' to computer 'b', then just run $ npm install on computer 'b'.

adapt-cli is definitely the easiest setup method, once you've got it installed and working! Just trying to highlight workarounds for when you can't.

Picture of Scott L
Re: adapt-cli installation failure (Win7, Node 7.9.0)
by Scott L - Saturday, 22 April 2017, 3:10 PM
 

Both of those scenarios had crossed my mind, but wasn't sure if there was anything else. Thanks for making it clear, Matt. You guys have been very helpful.