Open netpoe opened 8 years ago
It says something in the output about updating depreciated npm via
npm -g install npm@latest-2
Anyway if you update everything incluing meteor 1.2 you might need to change the nodes version in the settings file to 0.10.40 The fibers error I recall happens in that case.
Thanks @MasterJames, a few questions:
npm -g install npm@latest-2
need to be executed on the remote server's root or an specific folder?settings.json
file? Does it have to do with the "engines": {"node": ">=0.10.40"}
as in package.json
?Think I found how to specify the nodeVersion
in the mup.json
file:
// WARNING: nodeVersion defaults to 0.10.36 if omitted. Do not use v, just the version number.
"nodeVersion": "0.10.40",
Am I right?
Maybe reinstall npm all together. Once you have npm updated or installed freshly on your local deployment box where you run mupx. The -g flag is global and so where you install irrelavent. Otherwise you do it in the project folder same as where you run mupx I suppose. Try both separately (Uninstall other) to see if that makes a difference. Run "meteor update" to update meteor and all included packages. The last line of the settings file in the configuration shown in the Readme of the mupx repo (similar in both versions).
"deployCheckWaitTime": 120
It's in seconds extending it will again just confirm that's not the problem. Lower it later when it's working and/or if it doesn't make a difference.
Yes sorry wrong value you found the right one.
No success, tried:
npm -g install npm@latest
and npm -g install npm@latest-2
, both in local and remote server"nodeVersion": "0.10.40"
to the mup.json
filedeployCheckWaitTime: 120
to 120 and still getting the same error, this is the output: Verifying deployment: FAILED
-----------------------------------STDERR-----------------------------------
ehavior.
npm WARN package.json meteor-dev-bundle@0.0.0 No description
npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle@0.0.0 No README data
=> Starting meteor app on port:80
/bundle/bundle/programs/server/node_modules/fibers/future.js:245
throw(ex);
^
Error: Cannot find module 'mandrill-api/mandrill'
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.Npm.require (/bundle/bundle/programs/server/boot.js:150:18)
at server/methods/methods-emails.js:1:20
at /bundle/bundle/programs/server/app/server/methods/methods-emails.js:48:4
at /bundle/bundle/programs/server/boot.js:242:10
at Array.forEach (native)
at Function._.each._.forEach (/bundle/bundle/programs/server/node_modules/underscore/underscore.js:79:11)
=> Redeploying previous version of the app
-----------------------------------STDOUT-----------------------------------
To see more logs type 'mup logs --tail=50'
The main problem is with this file: /bundle/bundle/programs/server/app/server/methods/methods-emails.js
requesting the 'mandrill-api/mandrill'
module like this:
let mandrill = Npm.require('mandrill-api/mandrill');
I read in other issues that they installed the module manually on the server?
If not, maybe something with where is the Npm.require()
trying to search for the node_modules
directory?
I checked on the server for the /opt/appName/current/bundle/programs/server/package.json
file and I think that's the package.json
that's specifying the modules on use. Maybe mupx deploy
is not adding it to the bundle correctly?
So you added it as well as later calling Npm.require right? I'm no expert at this problem but it is reminiscent of some earlier issue? Anyway I'm here to help isolate what's happening. Being remote makes it hard and slow going. Trial and error is the process to isolation. I did a simple Google maybe this will help? http://stackoverflow.com/questions/9023672/nodejs-how-to-resolve-cannot-find-module-error The other example I thought about as I recall the package was not able to be built on the target without what I'm not sure. I'll dig more while you check that link.
I have been deploying my meteor app on a Mac flawlessly until I added a node_module and call the
Npm.require
method.This works fine in
localhost:3000
but not withmupx deploy
:Here's the log:
Here's my
package.json
Here's the code where
Npm.require()
is called (also tried withmeteorhacks:npm
Meteor.npmRequire()
:I also tried, before posting this issue:
#614
@arunoda asked for the reproducible app as well, here's the repo.
Server info
DigitalOcean UBUNTU droplet