0

We use Codeship for continuous integration and Modulus for hosting our projects. Code was running properly until last week, now I'm getting the following error.

    → modulus deploy -p 'project_name'
Welcome to Modulus
You are logged in as user_name
Selecting project_name

Compressing project...
5.7 MB written
Uploading project...
Upload progress [===================] 100%
Deploying Project...
Starting build.
Creating directories for build environment.
Downloading source.
Executing build.
Package found: /package.json
Installing node 0.10.25
Installing npm 3.3.4
Installing packages from /package.json

module.js:340
    throw err;
          ^
Error: Cannot find module 'are-we-there-yet'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/mnt/home/.nvm/v0.10.25/lib/node_modules/npm/node_modules/npmlog/log.js:2:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
npm install failed, trying again

Here is the package.json file

{
  "name": "project-name",
  "version": "0.0.1-77",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node index.js"
  },
  "engines": {
    "node": "0.10.25",
    "npm": "2.x.x"
  },
  "author": "author_name",
  "license": "ISC",
  "dependencies": {
    "express": "3.5.1",
    "underscore": "^1.6.0",
    "handlebars": "^3.0.3",
    "rendr": "1.0.3",
    "rendr-handlebars": "0.2.0",
    "request": "~2.30.0",
    "config": "^0.4.35"
  },
  "devDependencies": {
    "grunt": "^0.4.4",
    "grunt-browserify": "^1.2.12",
    "grunt-contrib-concat": "^0.5.0",
    "grunt-contrib-handlebars": "^0.8.0",
    "grunt-contrib-less": "^0.11.0",
    "grunt-contrib-watch": "^0.6.1",
    "nodemon": "^1.0.17"
  }
}

Note- The project was working perfectly fine a week back. Now I'm facing this issue.

Pankaj
  • 592
  • 7
  • 19
  • possible duplicate of [npm doesnt work, get always this error -> Error: Cannot find module 'are-we-there-yet'](http://stackoverflow.com/questions/31025048/npm-doesnt-work-get-always-this-error-error-cannot-find-module-are-we-ther) – Claies Sep 30 '15 at 06:33
  • @Claies It was working week ago. The exact same code, works on local machine. – Pankaj Sep 30 '15 at 06:34
  • ok, but did you try the answer in the other question? it basically says that there is a missing file within NPM itself, which could happen for any number of reasons, and the fact that it was working a week ago has no bearing on a missing file *now*. – Claies Sep 30 '15 at 06:36
  • @Claies I already tried that solution before posting the question! – Pankaj Sep 30 '15 at 06:37
  • well if you **completely reinstalled** NPM, as the answer to the other question stated, then you must have something corrupt in your OS if it is still complaining about a core module of NPM not being available. – Claies Sep 30 '15 at 06:39
  • @Claies It must not completely related to NPM that's what i suspect. As I'v e mentioned in my question we use codeship and modulus.io if you're not aware and I suspect I'm missing something on the integration part rather than NPM versions. That's where it differs from the question you've provided a link to and marked as duplicate. – Pankaj Sep 30 '15 at 06:42
  • @pankaj Im also having the same issue, with a brand new get of npm and node today. – Robbie Tapping Sep 30 '15 at 07:01
  • @RobbieTapping Ditto here... same problem on a brand new install. I get the exact error when installing npm-gyp on Ubuntu 14.04 – Sunny Sep 30 '15 at 09:42
  • @Samir any luck on your ends with this issue? Have either of you tried using the new v4.0.0 release of node and npm? also What machines are you on? Windows/Linux or mac? if its Linux is it Ubuntu? – Robbie Tapping Oct 01 '15 at 00:57
  • @Robbit Tapping I deleted all traces of node and npm: sudo apt-get remove and sudo npm uninstall. Then find / -name \*npm\* -print and the same on node... manually deleted remnant files which were npm & node related. Then installed node from sudo curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - . This gives another instruction at the end to complete the installation. Then finally installed npm. I am having an older version of npm 2.14.4? Before installing node-gyp, had to sudo apt-get install libxtst-dev libpng-dev. Installed socket.io. Works well... for now. Good luck! – Sunny Oct 01 '15 at 08:35
  • @Robbit Tapping. Thats sudo find / -name \\*npm\\* -print and sudo find / -name \\*node\\* -print to get all files with "npm" or "node" in them. Just in case you are not familiar with this... They are all not necessarily node and npm related. You need to check before deleting them individually. – Sunny Oct 01 '15 at 08:38

2 Answers2

1

I had the same problem with modulus.io. Worked last week. Failed today. I fixed it by specifying the npm version explicitly in my packages.json.

"engines": {
  "node": "0.10.22",
  "npm": "1.3.14"
}

I think in your case the 2.x.x isn't valid because the log output shows modulus using 3.3.4 anyway.

-- jonathan

kung-foo
  • 226
  • 2
  • 3
  • 8
0

This is still an active issue on Modulus. I've found through some hard lessons that you definitely need to make sure you're making conscious decisions for component versions. All the way from node and npm versions, to things in package.json. If you specify latest version, you will end up with errors when you least want them.

Example. In package.json:

"engines": {
"node": "0.10.18",
"npm": "1.3.8"
},

I also suggest periodically upgrading components selectively if needed.

Dave Young
  • 66
  • 2