XervoIO / demeteorizer

Converts a Meteor app into a standard Node.js application.
http://npm.im/demeteorizer
MIT License
703 stars 59 forks source link

Modulus still uses nodejs 0.10.x to deploy an app #243

Closed vladejs closed 7 years ago

vladejs commented 8 years ago

If I upload my source code to modulus, it says is using node 4.4.7 and latest npm.

But that's only to install my npm deps. After the app is demeteorized, it actually run it with node v0.10.x.

I can only change that behaviour if I demeteorize locally and change node version on package.json file.

As a result, all my apps are getting an Assertion error. undefined == function.

To reproduce the issue just do this:

  1. meteor create itwillfail
  2. Zip the itwillfail content (not the folder itself)
  3. Upload the zip to modulus via web interface

I use v1.4.1 but it happens in every meteor version you use.

jackboberg commented 8 years ago

You can use --node-version to specify what you want written to the package.json. This option is also available to the modulus CLI.

vladejs commented 8 years ago

How I' am suppose to specify --node-version when I upload my source code to modulus via web interface?

vladejs commented 8 years ago

Lol. @theworkflow , the idea is to upload only my source code and let modulus demeteorize de project, because is a meteor project, not a nodejs one.

jackboberg commented 8 years ago

@vladejs You are right, and unmodified source zip will default to whatever is in boot.js. demeteorizer could maybe pull from a root package.json engines property if specified..

jackboberg commented 8 years ago

@vladejs sorry for the confusion, I think the issue is differentiating between what demeteorizer does (or should do)...and what modulus does (or should do).

vladejs commented 8 years ago

Modulus always uses demeteorizer

jackboberg commented 8 years ago

maybe we can include copying over the root package.json engines property as a part of onmodulus/demeteorizer#228

vladejs commented 8 years ago

Sure, that would be a fix

vladejs commented 7 years ago

Hello @jackboberg , noticed #228 and #250 didn't solved my problem with Modulus, I have updated my package.json with engines property to use node v4.5.0 and when deploying to Modulus, I got the same node version no matter what.

This is what I get every single time I do modulus deploy:

Deploying project into Meteor runtime... Starting build. Creating directories for build environment. Downloading source. Executing build. Now using node v4.4.7 (npm v3.10.5) Installing root package.json dependencies.

vladejs commented 7 years ago

PLEASE FIX THIS. I can't even deploy using CODESHIP. On the above output it says

Now using node v4.4.7 (npm v3.10.5)

BUT, when deploy finishes it says:

Now using node v0.10.41 (npm v1.4.29)
deploy -> v0.10.41
Installing packages from /mnt/output/bundle/programs/server/package.json
...

This is critical.

The only way I can now set a working project on Modulus is by:

  1. Demeteorizing locally
  2. Changing engines property on /program/server/package.json to use node 4.5.0
  3. Compress the HUGE bundle and upload to Modulus via web interface

CodeShip Logs

Following is the complete output on Codeship (which just did modulus deploy)

Welcome to Modulus
You are logged in as cybertouchsolutions
Selecting amhstracker

Deploying Meteor version 1.4.2.3

Compressing project...
1.4 MB written
Uploading project...

Deploying project into Meteor runtime...
Starting build.
Creating directories for build environment.
Downloading source.
Executing build.
Now using node v4.4.7 (npm v3.10.5)
Installing root package.json dependencies.

> bcrypt@0.8.7 install /mnt/input/node_modules/bcrypt
> node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
make: Entering directory `/mnt/input/node_modules/bcrypt/build'
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
COPY Release/bcrypt_lib.node
make: Leaving directory `/mnt/input/node_modules/bcrypt/build'
meteorkits-starterkit@0.0.1 /mnt/input
bcrypt@0.8.7 
bindings@1.2.1 
nan@2.3.5 
UNMET PEER DEPENDENCY graphql@^0.8.2
meteor-node-stubs@0.2.4 
asn1.js@4.9.0 
assert@1.4.1 
Base64@0.2.1 
base64-js@1.2.0 
bn.js@4.11.6 
brorand@1.0.6 
browserify-aes@1.0.6 
browserify-cipher@1.0.0 
browserify-des@1.0.0 
browserify-rsa@4.0.1 
browserify-sign@4.0.0 
browserify-zlib@0.1.4 
buffer@4.9.1 
buffer-shims@1.0.0 
buffer-xor@1.0.3 
cipher-base@1.0.3 
console-browserify@1.1.0 
constants-browserify@1.0.0 
core-util-is@1.0.2 
create-ecdh@4.0.0 
create-hash@1.1.2 
create-hmac@1.1.4 
crypto-browserify@3.11.0 
date-now@0.1.4 
des.js@1.0.0 
diffie-hellman@5.0.2 
domain-browser@1.1.7 
elliptic@6.3.2 
events@1.1.1 
evp_bytestokey@1.0.0 
hash.js@1.0.3 
http-browserify@1.7.0 
https-browserify@0.0.1 
ieee754@1.1.8 
indexof@0.0.1 
inherits@2.0.1 
isarray@1.0.0 
miller-rabin@4.0.0 
minimalistic-assert@1.0.0 
os-browserify@0.2.1 
pako@0.2.9 
parse-asn1@5.0.0 
path-browserify@0.0.0 
pbkdf2@3.0.9 
process@0.11.9 
process-nextick-args@1.0.7 
public-encrypt@4.0.0 
punycode@1.4.1 
querystring@0.2.0 
querystring-es3@0.2.1 
randombytes@2.0.3 
readable-stream@2.2.1 
ripemd160@1.0.1 
sha.js@2.4.8 
stream-browserify@2.0.1 
string_decoder@0.10.31 
timers-browserify@1.4.2 
tty-browserify@0.0.0 
url@0.11.0 
punycode@1.3.2 
util@0.10.3 
util-deprecate@1.0.2 
vm-browserify@0.0.4 
mobx@2.7.0 
mobx-react@3.5.9 
hoist-non-react-statics@1.2.0 
react@15.4.1 
fbjs@0.8.6 
core-js@1.2.7 
isomorphic-fetch@2.2.1 
node-fetch@1.6.3 
encoding@0.1.12 
iconv-lite@0.4.15 
is-stream@1.1.0 
whatwg-fetch@2.0.1 
promise@7.1.1 
asap@2.0.5 
ua-parser-js@0.7.12 
loose-envify@1.3.0 
js-tokens@2.0.0 
object-assign@4.1.0 
react-addons-css-transition-group@15.4.1 
react-bootstrap-table@3.0.0-beta.2 
classnames@2.2.5 
react-modal@1.6.4 
element-class@0.2.2 
exenv@1.2.0 
lodash.assign@4.2.0 
react-toastr@2.8.2 
lodash@4.17.2 
react-addons-update@15.4.1 
react-dom@15.4.1 
react-komposer@2.0.0 
babel-runtime@6.20.0 
core-js@2.4.1 
regenerator-runtime@0.10.1 
lodash.pick@4.4.0 
react-stubber@1.0.0 
shallowequal@0.2.2 
lodash.keys@3.1.2 
lodash._getnative@3.9.1 
lodash.isarguments@3.1.0 
lodash.isarray@3.0.4 
react-mounter@1.2.0 
domready@1.0.8 
react-no-ssr@1.1.0 
UNMET PEER DEPENDENCY simpl-schema@^0.0.3
uniforms@1.7.1 
lodash.clonedeep@4.5.0 
lodash.get@4.4.2 
lodash.isequal@4.4.0 
lodash.set@4.3.2 
lodash.xorwith@4.5.0 
uniforms-bootstrap3@1.7.1 

npm WARN uniforms@1.7.1 requires a peer of graphql@^0.8.2 but none was installed.
npm WARN uniforms@1.7.1 requires a peer of simpl-schema@^0.0.3 but none was installed.
Initializing Meteor environment.
Using METEOR@1.4.2.3.
Demeteorizing application...
Demeteorization complete.
npm WARN deprecated This version of npm lacks support for important features,
npm WARN deprecated such as scoped packages, offered by the primary npm
npm WARN deprecated registry. Consider upgrading to at least npm@2, if not the
npm WARN deprecated latest stable version. To upgrade to npm@2, run:
npm WARN deprecated 
npm WARN deprecated   npm -g install npm@latest-2
npm WARN deprecated 
npm WARN deprecated To upgrade to the latest stable version, run:
npm WARN deprecated 
npm WARN deprecated   npm -g install npm@latest
npm WARN deprecated 
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated 
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.

Now using node v0.10.41 (npm v1.4.29)
deploy -> v0.10.41

Installing packages from /mnt/output/bundle/programs/server/package.json
WARN: npm-shrinkwrap.json will override dependencies declared in package.json.
npm WARN npm npm does not support Node.js v0.10.41
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/

> fibers@1.0.15 install /mnt/output/bundle/programs/server/node_modules/fibers
> node build.js || nodejs build.js

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
make: Entering directory `/mnt/output/bundle/programs/server/node_modules/fibers/build'
CXX(target) Release/obj.target/fibers/src/fibers.o
CXX(target) Release/obj.target/fibers/src/coroutine.o
CC(target) Release/obj.target/fibers/src/libcoro/coro.o
SOLINK_MODULE(target) Release/obj.target/fibers.node
COPY Release/fibers.node
make: Leaving directory `/mnt/output/bundle/programs/server/node_modules/fibers/build'
Installed in `/mnt/output/bundle/programs/server/node_modules/fibers/bin/linux-x64-11/fibers.node`
meteor-dev-bundle@0.0.0 /mnt/output/bundle/programs/server
amdefine@1.0.1 
asap@2.0.5 
fibers@1.0.15 
meteor-promise@0.8.0 
promise@7.1.1 
semver@4.1.0 
source-map@0.1.32 
source-map-support@0.3.2 
underscore@1.5.2 

Uploading completed build.
Provisioning and deploying bundle to servos...

[] amhstracker running at name-93694.onmodulus.net

Modulus Logs

This is what modulus shows when the app is "deployed":

Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> meteor-dev-bundle@0.0.0 start /mnt/app/bundle/programs/server
> node ../../main

assert.js:93

  throw new assert.AssertionError({ 
  ^

AssertionError: "undefined" === "function"
    at wrapPathFunction (/mnt/app/bundle/programs/server/mini-files.js:77:10)
    at Object.<anonymous> (/mnt/app/bundle/programs/server/mini-files.js:108:24)
    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)
    at require (module.js:380:17)
    at Object.<anonymous> (/mnt/app/bundle/programs/server/boot.js:9:13)
    at Module._compile (module.js:456:26)
jackboberg commented 7 years ago

@vladejs I am taking a look at your project now. In our tests here, demeteorizer definitely supports setting the version via root package.json, and as you can see here Modulus updated the build image to use the new features from demeteorizer..

jackboberg commented 7 years ago

Update: able to reproduce, digging deeper. Thanks @vladejs for bringing this back to my attention.

jackboberg commented 7 years ago

@vladejs we rebuilt the docker images, updated the registry, and it seems to be resolved now:

Demeteorization complete.
Now using node v4.5.0 (npm v2.15.9)
deploy -> v4.5.0 *

Please try again and let me know if you still see the issue.

vladejs commented 7 years ago

Well @jackboberg , you almost got it. CodeShip is giving me a green flag, BUT, my app still fails.

Why?

See the output on your own comment:

Demeteorization complete. Now using node v4.5.0 (npm v2.15.9) deploy -> v4.5.0 *

It says NPM version 2.15.9 was used, so you can guess, NodeJS > 4 don't work well with NPM < 3. As a result, my meteor app is not getting right my npm dependencies. Please fix that in a way demeteorizer correctly reads the npm property on my package.json:

"engines": {
  "node": "4.4.7",
  "npm": "latest"
}
jackboberg commented 7 years ago

I saw that, and opened an issue here earlier: onmodulus/docker-build-meteor/issues/35

I think we should move this discussion there, since it's no longer an issue with demeteorizer

vladejs commented 7 years ago

Problem solved. CodeShip is now giving me a green flag.