parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

After 2.2.6 update

Open mikepaggi opened this issue 10 years ago • 22 comments

I'm getting this issue at the moment when trying to update with 2..2.6 on DreamHost VPS when attempting to connect to it the first time.

/node_modules/parse-server-gcs-adapter/index.js:4 const storage = require('gcloud').storage; ^^^^^ SyntaxError: Use of const in strict mode. at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object.<anonymous> (/PATH TO FOLDER/node_modules/parse-server/lib/index.js:16:30) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10)

mikepaggi avatar Apr 10 '16 00:04 mikepaggi

What version of Node.js are you running ? You need 4.3.

mllobere avatar Apr 10 '16 09:04 mllobere

I have 5.10.1 at the moment....I actually went back a bit to see if that was an issue with the new Node.js version and still has the same issue. That Parse-gcs-adapter looks new though

mikepaggi avatar Apr 10 '16 12:04 mikepaggi

I have 2.2.6 running on my local Ubuntu VM too and it works there with Node 5.10.1....do you think my VPS Is not honoring my node version?

mikepaggi avatar Apr 10 '16 12:04 mikepaggi

I looked at the logs and the version of Node is being honored....it's currently running Ubuntu 12.02 LTS I believe. Do you think there is some library issue? My local Ubuntu VM is 14.04 LTS

NVM_PATH=/home/USERNAME/.nvm/versions/node/v5.10.1/lib/node

mikepaggi avatar Apr 10 '16 13:04 mikepaggi

Seems to be a problem in the GCS adapter. I'll have a look.

flovilmart avatar Apr 11 '16 01:04 flovilmart

just tested in node 4.3, 4.4 and 5.9 and it all seems good.

flovilmart avatar Apr 11 '16 02:04 flovilmart

what OS? My VPS is running Ubuntu 12.02 or something like that. Think it's due to the OS libraries? Seems to work on 14.04

mikepaggi avatar Apr 11 '16 02:04 mikepaggi

It's most likely that node version is frozen on 12.04 and you have a default node version < 4.3. Starting 4.x node has all ES2015 features available without any special launch flag.

flovilmart avatar Apr 11 '16 03:04 flovilmart

The nodejs package provided by ubuntu 12.04 is http://packages.ubuntu.com/precise/nodejs (0.6.12) and in 14.04 http://packages.ubuntu.com/trusty/nodejs (0.10.25).

In this case you want to upgrade node v4.3 as we don't support earlier versions.

flovilmart avatar Apr 11 '16 11:04 flovilmart

It was working before the 2.2.6 update though(I had 2.2.2 running before)....I have Node 5.10.1 as of now and that's the latest version of Node. I setup using NVM and running "node -v" gives me 5.10.1 back.

Here's more of the error from when i try just POSTing to the functions/hello default. Looks to be just environment variables but it shows that I'm running 5.10.1 at the time of the request. I meant Ubuntu 12.04 as well in case of your reference above. ----- (blocking out my username and other specific private info) Environment variables MANPATH=/home/MYUSERNAME/.nvm/versions/node/v5.10.1/share/man:/usr/share/man:/usr/local/share/man NVM_CD_FLAGS= GEM_HOME=/home/MYUSERNAME/.gems SHELL=/bin/bash NVM_PATH=/home/MYUSERNAME/.nvm/versions/node/v5.10.1/lib/node PASSENGER_DEBUG_DIR=/tmp/passenger.spawn-debug.XXXXzpj2s9 NVM_DIR=/home/MYUSERNAME/.nvm USER= MYUSERNAME PATH=/home/MYUSERNAME/.nvm/versions/node/v5.10.1/bin:/home/MYUSERNAME/.gems/bin:/usr/lib/ruby/gems/1.8/bin/:/bin:/usr/bin:/sbin:/usr/sbin runlevel=3 RUNLEVEL=3 NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist PWD=/home/MYUSERNAME/MYURL VERBOSE=no NODE_PATH=/dh/passenger/node_lib previous=N PREVLEVEL=N HOME=/home/MYUSERNAME SHLVL=2 UPSTART_INSTANCE= LOGNAME= MYUSERNAME UPSTART_EVENTS=runlevel GEM_PATH=/home/MYUSERNAME/.gems/:/usr/lib/ruby/gems/1.8 NVM_BIN=/home/MYUSERNAME/.nvm/versions/node/v5.10.1/bin NVM_IOJS_ORG_MIRROR=https://iojs.org/dist UPSTART_JOB=rc IN_PASSENGER=1 PYTHONUNBUFFERED=1 RAILS_ENV=production RACK_ENV=production WSGI_ENV=production NODE_ENV=production PASSENGER_APP_ENV=production

mikepaggi avatar Apr 11 '16 13:04 mikepaggi

So you still have the error with node 5.10?

flovilmart avatar Apr 11 '16 13:04 flovilmart

Can you try with 4.3, as you use nvm, that should be fairly easy to switch

flovilmart avatar Apr 11 '16 13:04 flovilmart

still same issue....one thing i stumbled upon. When i deleted the modules as reinstalled with npm install I see this build error....

make: Entering directory `/home/MYUSERNAME/MYURL/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build' CXX(target) Release/obj.target/crc32c_sse42/src/crc32c_sse42.o AR(target) Release/obj.target/crc32c_sse42.a COPY Release/crc32c_sse42.a CXX(target) Release/obj.target/sse4_crc32/src/crc32c.o In file included from ../src/crc32c.cpp:18:0: ../node_modules/nan/nan.h:41:3: error: #error This version of node/NAN/v8 requires a C++11 compiler In file included from /home/MYUSERNAME/.node-gyp/4.3.2/include/node/node.h:42:0,

It seems that module is connected to the parse-server-gcs-adapter and can't build due to needing a newer C++ compiler. I"m guessing my Ubuntu VPS needs to be updated...but I doubt DreamHost will do that until they want to.

mikepaggi avatar Apr 11 '16 13:04 mikepaggi

what is GCS adapter anyway? I don't use this....I have a local MongoDB on my VPS. I was able to get it installed on my VM on my Mac of Ubuntu 14.04 once I installed g++, which added in the C++ compiling. I would prefer not having to copy the modules since I worry sometimes how updates and installs happen unless it's on the box.

mikepaggi avatar Apr 11 '16 13:04 mikepaggi

the GCS adapter is a storage adapter for the Files to google cloud. This is a dev dependency, so it should not build in production. to make sure you don't rebuild dev dependencies, use npm install --production

flovilmart avatar Apr 11 '16 14:04 flovilmart

thank you so much i didn't know about --production. It seems to be working now :-)

one thing i do notice failing is something around [email protected]. I'm gathering that's not a module you guys maintain?

mikepaggi avatar Apr 11 '16 14:04 mikepaggi

it's a dependency from gcloud provided by parse-server-gcs-adapter and it's been removed from the dependencies. If you still see it, use npm prune --production to clean the node_modules directory.

flovilmart avatar Apr 11 '16 15:04 flovilmart

@mikepaggi feel free to close when it's all good for you

flovilmart avatar Apr 11 '16 15:04 flovilmart

Do I do that on the Parse-Server directory or for the gcs-adapter?

mikepaggi avatar Apr 11 '16 16:04 mikepaggi

Parse-Server.

drew-gross avatar Apr 14 '16 21:04 drew-gross