Closed Bug 1310847 Opened 9 years ago Closed 9 years ago

create-test-environment fails with "Cannot find module 'npmlog'" on new vagrant boxes

Categories

(MozReview Graveyard :: Testing / Development Environment, defect)

Development/Staging
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mars, Assigned: mars)

Details

Attachments

(1 file)

After updating the bento/centos-7.2 vagrant box image to v 2.3.0, create-test-environment fails with an npm error. Log excerpt: [vagrant@localhost vct]$ ./create-test-environment ... pip installs stuff ... Successfully installed Babel-1.3 Django-1.6.11.3 Jinja2-2.7.3 Markdown-2.4.1... You are using pip version 8.0.3, however version 8.1.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command. module.js:457 throw err; ^ Error: Cannot find module 'npmlog' at Function.Module._resolveFilename (module.js:455:15) at Function.Module._load (module.js:403:25) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at /usr/lib/node_modules/npm/bin/npm-cli.js:19:13 at Object.<anonymous> (/usr/lib/node_modules/npm/bin/npm-cli.js:75:3) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) The ansible script to configure the box upgrades npm. The output was normal, if a bit sparse. We should check the verbose ansible output. TASK [vct-dev-environment : install nodejs and npm] **************************** changed: [default] => (item=[u'nodejs', u'npm']) TASK [vct-dev-environment : upgrade npm] *************************************** changed: [default] npm throws the same error even if you try and check the installed version: [vagrant@localhost vct]$ npm --version module.js:457 throw err; ^ Error: Cannot find module 'npmlog' Additional info: [vagrant@localhost vct]$ which npm /usr/bin/npm [vagrant@localhost vct]$ yum list npm Installed Packages npm.x86_64 1:3.10.3-107.el7 @epel Available Packages npm.noarch 1.3.6-5.el7 epel
Comment on attachment 8801918 [details] vagrant: install recent node and npm from nodesource (Bug 1310847). https://reviewboard.mozilla.org/r/86518/#review85598 ::: ansible/roles/vct-dev-environment/tasks/nodejs.yml:16 (Diff revision 1) > - with_items: > - - nodejs > + key: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL > + state: present > - - npm > > -# npm v1.3.6 halts waiting for user input, even with '-y'. Upgrade to the > -# latest version so 'npm init -y' works properly. > +- name: add the nodesource repositories. > + yum: This is very different from the way the docker vendor repo is installed in this same role (see docker.yml). For that reason, please add a comment with a link to the install docs or script that held this URL. That way other developers can find where this crazy repo URL came from, and why it's done this way, in case we have to change it or fix something in future. ::: ansible/roles/vct-dev-environment/tasks/nodejs.yml:21 (Diff revision 1) > -# latest version so 'npm init -y' works properly. > -# FIXME: make this idempotent > -- name: upgrade npm > - command: /usr/bin/npm -g install npm > + yum: > + name: "https://rpm.nodesource.com/pub_6.x/el/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/nodesource-release-el{{ ansible_distribution_major_version }}-1.noarch.rpm" > + state: present > + > +- name: install nodejs and npm. > + yum: "name=nodejs state=present enablerepo='epel,nodesource'" Not sure why these parameters are surrounded in double quotes. Is it possible to surround just the `enablerepo` parameter to match the rest of the code?
Attachment #8801918 - Flags: review?(mars) → review-
Comment on attachment 8801918 [details] vagrant: install recent node and npm from nodesource (Bug 1310847). https://reviewboard.mozilla.org/r/86518/#review86642 LGTM
Attachment #8801918 - Flags: review?(mars) → review+
Pushed by smacleod@mozilla.com: https://hg.mozilla.org/hgcustom/version-control-tools/rev/a35154a63139 vagrant: install recent node and npm from nodesource . r=mars
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: