I am not a developer but I am asked to migrate a release 1.3.4.1 Meteor deployment to a new (CentOS 7) platform. The original company vanished and the app developer is gone and not cooperating ... :(
Only thing as far as I know is the release.
When I run the following command on the new server:
meteor run --port 3000 --release 1.3.4.1
I see a lot of things (downloading packages, building, linking, ..) running well but after some minutes I end up with a syntax error in the build modules.js when the app is started:
[meteor#rfcwerkboek rfc-project]$ meteor run --port 3000 --release 1.3.4.1
[[[[[ ~/prod/rfc-project ]]]]]
=> Started proxy.
W20190116-00:49:49.745(1)? (STDERR)
W20190116-00:49:50.037(1)? (STDERR) /home/meteor/prod/rfc-project/.meteor/local/build/programs/server/packages/modules.js:26622
W20190116-00:49:50.038(1)? (STDERR) matches.forEach(nextMatch => {
W20190116-00:49:50.038(1)? (STDERR) ^
W20190116-00:49:50.039(1)? (STDERR) SyntaxError: Unexpected token >
W20190116-00:49:50.039(1)? (STDERR) at /home/meteor/prod/rfc-project/.meteor/local/build/programs/server/boot.js:292:30
W20190116-00:49:50.040(1)? (STDERR) at Array.forEach (native)
W20190116-00:49:50.041(1)? (STDERR) at Function._.each._.forEach (/home/meteor/.meteor/packages/meteor-tool/.1.3.4_1.wmvsc.7d2bga++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20190116-00:49:50.041(1)? (STDERR) at /home/meteor/prod/rfc-project/.meteor/local/build/programs/server/boot.js:133:5
=> Exited with code: 8
The piece of code in modules.js where the syntax error occurs is:
var fileFound = null;
matches.forEach(nextMatch => {
if( fileFound !== null ) return;
if( nextMatch[1].length < 1 ){
fileFound = new Buffer(0);
return;
}
Removing the build and starting the process again does not solve the issue.
Just some now a I discovered a file called .node_version.txt in .meteor/local/build/ which says:
v0.10.45
My new CentOS 7 distro has nodejs version:
[meteor#rfcwerkboek rfc-project]$ node --version
v6.14.3
I guess that's probably the cause of the problem. Am I right? If I am right should I downgrade nodejs by removing the standard nodejs RPM's and compile and old version from scratch?
Meteor is shipped with a builtin node binary, so you don't require a node installation at your development system.
However, if your CentOS is your targeted server where your app will be deployed you need the exact node version to be installed in order to execute your bundled app (but no Meteor install is required on the server).
Background
Meteor itself is mainly a development framework, which combines good practices and tools and bundles all that code into a node application, that runs like every other node application.
In oder to get the node version, that is required to be installed on your server you can go to your project directory and let Meteor print it's node version:
$ cd myproject
$ meteor node -v
0.10.45
which would be for example the node version for a Meteor 1.7 release. So if you want to run your build on your server it requires this node version.
Note, that if the version from the command differs with the one from the .node_version.text then the version you receive from meteor node -v is the one that is used when running meteor build and that should be installed on the server.
The Meteor guide on custom deployment is summarizing this in an understandable way and should be consulted as further readig. Resolving this issue should also solve the error.
Long story short
Meteor is a development framework with a shipped node binary
Your server does not require Meteor to be installed
The local development OS does not require an additional node installation
All npm commands on the development machine should be executed using meteor npm <command>
The server requires the same node version as the one that is shipped with Meteor
Related
I have this error when I run npm run dev or npm run watch and I didn't find what is the mess. It's happens in a all fresh Laravel 8 app.
It looks like happen when I use the developement command
ERROR in ./resources/css/app.css
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js):
TypeError: [(...variantsValue),(...extensions)].flat is not a function
at /var/www/html/smart_recipe/node_modules/tailwindcss/lib/util/resolveConfig.js:219:73
at baseMergeDeep (/var/www/html/smart_recipe/node_modules/lodash/_baseMergeDeep.js:42:7)
at /var/www/html/smart_recipe/node_modules/lodash/_baseMerge.js:27:7
at /var/www/html/smart_recipe/node_modules/lodash/_createBaseFor.js:17:11
at baseMerge (/var/www/html/smart_recipe/node_modules/lodash/_baseMerge.js:24:3)
at /var/www/html/smart_recipe/node_modules/lodash/mergeWith.js:36:3
at /var/www/html/smart_recipe/node_modules/lodash/_createAssigner.js:30:9
at apply (/var/www/html/smart_recipe/node_modules/lodash/_apply.js:15:25)
at /var/www/html/smart_recipe/node_modules/lodash/_overRest.js:32:12
at mergeVariantExtensions (/var/www/html/smart_recipe/node_modules/tailwindcss/lib/util/resolveConfig.js:218:33)
at resolveVariants (/var/www/html/smart_recipe/node_modules/tailwindcss/lib/util/resolveConfig.js:235:10)
at resolveConfig (/var/www/html/smart_recipe/node_modules/tailwindcss/lib/util/resolveConfig.js:271:15)
at /var/www/html/smart_recipe/node_modules/tailwindcss/lib/index.js:77:37
at /var/www/html/smart_recipe/node_modules/tailwindcss/lib/processTailwindFeatures.js:52:20
at LazyResult.run (/var/www/html/smart_recipe/node_modules/postcss/lib/lazy-result.js:288:14)
at LazyResult.asyncTick (/var/www/html/smart_recipe/node_modules/postcss/lib/lazy-result.js:212:26)
at LazyResult.asyncTick (/var/www/html/smart_recipe/node_modules/postcss/lib/lazy-result.js:225:14)
at /var/www/html/smart_recipe/node_modules/postcss/lib/lazy-result.js:217:17
at runLoaders (/var/www/html/smart_recipe/node_modules/webpack/lib/NormalModule.js:316:20)
at /var/www/html/smart_recipe/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /var/www/html/smart_recipe/node_modules/loader-runner/lib/LoaderRunner.js:233:18
at context.callback (/var/www/html/smart_recipe/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Promise.resolve.then.then.catch (/var/www/html/smart_recipe/node_modules/postcss-loader/src/index.js:208:9)
# ./resources/css/app.css
I came across same issue and spent 5 hours on finding solution but could not.
After searching alot, I came across this
"Tailwind CSS v2.0 no longer supports Node.js 8 or 10. To build your CSS you'll need to ensure you are running Node.js 12.13.0 or higher in both your local and CI environments."
at https://tailwindcss.com/docs/upgrading-to-v2
So I realized that issue was in my Node version which was 10.x so
I uninstalled Node from my windows machine and downloaded LTS version (14.x).
So consider updating your Node version, it will solve the issue as it did work for me.
There is possibility that old node versions don't have that flat function that Tailwind CSS 2 has implemented and that's throwing error.
I Had the exact same issue after installing Breeze... Unfortunately the npm error message gives no clue of what is really going on !
Thanks to #DaniyalGondal I found out that my node version was raising the error because of tailwind V2 requirements (https://tailwindcss.com/docs/upgrading-to-v2) that comes with Breeze... So I did upgrade my node version using : sudo n latest under ubuntu20
Don't forget to restart your terminal after upgrading and check that your node is correctly upgraded using : node --version
If the node version is above 12.13.0, now npm run watch or npm run dev should work fine !
I am creating a panel in Adobe Premiere Pro which used Google Cloud speech. I am accessing google-cloud/speech on the Javascript side, not JSX side via NodeJS. I am also accessing google-cloud/storage. No big deal, I installed NodeJS on a Mac and functions accessing google-cloud/storage were easy to code.
After following the instructions to npm --save #google-cloud/speech and npm --save #google-cloud/storage, it created the node_modules directory. I have moved them to a custom directory but they are duplicated in the standard location also.
In my code, I reference them as per the google-cloud examples:
// note cep.node is required in the Adobe CEP environment to access nodejs
const speech = cep_node.require(extention_path+'/lib/node_modules/#google-cloud/speech');
const project_id ='project_id_xxx1234';
const keyFilePath = extention_path +'/path/to/key.json';
const client = new speech.v1.SpeechClient({
projectId: project_id,
keyFilename: keyFilePath,
});
I've tried this w/o the ids and speech.SpeechClient() etc as per examples. The methodology is working fine with google-cloud/storage, so I know the similar downloaded node modules at the same location work fine for that.
However, it fails on trying to make a new speech.SpeechClient() with the browser debug error below.
Uncaught Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v51-darwin-x64-unknown
Found: [.DS_Store, node-v64-darwin-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module '/Library/Application Support/Adobe/CEP/extensions/com.iv.PProPanel/lib/node_modules/grpc/src/node/extension_binary/node-v51-darwin-x64-unknown/grpc_node.node'
at Object. (/Library/Application Support/Adobe/CEP/extensions/com.iv.PProPanel/lib/node_modules/grpc/src/grpc_extension.js:53:17)
at Module._compile (module.js:595:32)
at Object.Module._extensions..js (module.js:610:10)
at Module.load (module.js:512:32)
at tryModuleLoad (module.js:471:12)
at Function.Module._load (module.js:463:3)
at Module.require (module.js:522:17)
at require (internal/module.js:20:19)
at Object. (/Library/Application Support/Adobe/CEP/extensions/com.iv.PProPanel/lib/node_modules/grpc/src/client_interceptors.js:145:12)
at Module._compile (module.js:595:32)
My belief is that these series of node_modules that are accessed by #google-cloud/speech were compiled use NODE_MODULE_64 and need 51 (instead).
$ npm rebuild rebuilds (or checks current version of the modules) fine with the exception
protobufjs#6.8.8 postinstall /Library/Application Support/Adobe/CEP/extensions/com.iv.PProPanel/lib/node_modules/protobufjs
node scripts/postinstall
grpc#1.14.1 install /Library/Application Support/Adobe/CEP/extensions/com.iv.PProPanel/lib/node_modules/grpc
node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp WARN Using request for node-pre-gyp https download
[grpc] Success: "/Library/Application Support/Adobe/CEP/extensions/com.iv.PProPanel/lib/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
So some module needs v51 instead of the build v64. The question is can the #google-cloud/speech modules be built using v51 and how? or do I wait for google-cloud to come up with a solution? BTW: I also renamed the node-v64 dir to node-51, but received another error referencing the MODULE 51. Any direction would be appreciated.
Some of the dependencies for #google-cloud/speech are native addons. Those being C/C++ code, they need to be compiled for the correct Node version. Looks like your Node version that you used for npm install doesn't match the one in Adobe CEP. Switch to Node 5.1 and run npm install or npm rebuild again.
I recommend using nvm to change Node versions, see Node Version Manager.
Ok, let's make it simple :
I migrated my working node.js app to a new server today. The app spawns casperjs processes to do stuff.
Problem :
It doesn't run anymore
Why?
output casperjs --version from any folder but the one where my node app is installed :
root#xxxxx:/var# casperjs --version
1.1.0-beta3
now from the folder where my node app is installed :
root#xxxxx:/var/nodeapp# casperjs --version
Error: Cannot find module 'sys'
phantomjs://bootstrap.js:289
phantomjs://bootstrap.js:254 in require
/var/nodeapp/node_modules/system/engines/node/system.js:8
/var/nodeapp/node_modules/system/engines/node/system.js:45
1.1.0-beta3
Isn't that weird? :D Thanks for any insights
Edit : Tried uninstalling casper, then reinstalling from npm (I used github before). Same error.
-DEV was the previous version (see https://github.com/n1k0/casperjs/commit/9f510ed68010b3fadc8842115a12d2712213779d#diff-b9cfc7f2cdf78a7f4b91a753d10865a2 ), up to about 4 months ago. So 1.1-beta2 should give you that.
You could also try getting the latest git version; you can see a list of changes since 1.1.0-beta3 here (I don't spot your problem though): https://github.com/n1k0/casperjs/compare/1.1-beta3...master
By the way, are you running the same PhantomJS version on each of the working and non-working server? (Actually, what I would do next is upgrade your other server to first CasperJS 1.1-beta3, then the latest PhantomJS, and see if it breaks. If not, then it is not the software version but something else about the environment of the new server.)
meteor (v0.6.6.3) on openShift, customized openShift nodeJS to 0.10.21, mongoDB 2.2
I try to get a meteor app running on openShift. I have upgrade the nodeJS from the openShift default 0.10.5 to nodeJS 0.10.21 because meteor needs this nodeJS version as minimum.
If i open a ssh shell to openShift and let give me the node version than it shows me correct my upgraded version of 0.10.21 ( node --version ).
But if i will start the meteor application they see a nodeJS version of 0.10.5 (console log out with 'process.version' ) and starts again, again, again...
Can someone point me to the direction where i can look what's happened or what i'm doing wrong.
thanks
I 've prepared this "quickstart" solution,
it uses METEOR + NODE v0.10.24 (but it can be changed)
with Meteor example LeaderBoard and it can be easy transformed to your real application.
I have tested on Meteor 0.7.0.1
see: https://github.com/vladka/openshift-meteor-leaderboard-customNode
Edit (06.aug.2014)
As of now openshift is running nodejs version v0.10.25 which should be fine for running a meteor app. I am currently running one that is based on the 0.8.2/3 version.
Outdated answer (20. jan. 2014)
I have found the following repo, that according to the description lets you use any custom nodejs version.
Note: I am trying it out as we speak and will report back.
Edit
After 6 hours of trying out:
2 different app bootstraps (ryanj, openshift)
3-4 different nodejs cartridges from this repo
I gave up these approaches.
But made it work via the following steps:
I downgraded meteor to 0.6.5
meteor update --release 0.6.5
Used demeteorizer to "bundle app"
Copied contents of folder into the openshift dir created by following this tutorial
Replaced process.env.ROOT_URL in meteorshim with
process.env.ROOT_URL = "http://" + (process.env.OPENSHIFT_APP_DNS || "localhost");
Updated MIN_NODE_VERSION in programs/server/boot.js with:
var MIN_NODE_VERSION = 'v0.10.5';
git push and app was up & running
Changing the version of the software installed by a cartridge is not supported, but you can make a DIY app that has the version you want or roll you own nodejs cartridge with the version you want.
I created the openshift app using nodejs-0.10 instead of nodejs-0.6.
Then i followed this repo as mentioned by Matyas.
As the final step, i added new openshift env variable, something like:
rhc env add OPENSHIFT_youruniquestring_PATH_ELEMENT=/var/lib/openshift/xxxxxxxx/app-root/data/node-v0.10.29-linux-x64/bin -a yourAppName
Please adjust the values above to match yours.
After that try to make some dummy changes to your source code, then commit and push.
Once finished, you should run on node 0.10.29.
It worked for me, my app now running on meteor 0.8.3 with node 0.10.29
I am trying to implement this program on my window system but i am getting this error .
Administrator#rahul ~/nodepad
$ node app.js
native library not built
Express server listening on port 3000, environment: development
Using connect 0.5.9, Express 1.0.7, Jade 0.6.3
node.js:50
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: EPERM, Operation not permitted
at Stream._onConnect (net.js:687:18)
at IOWatcher.onWritable [as callback] (net.js:284:12)
Please suggest why this errror is coming .
Thanks
Have you started a mongodb instance? Nodepad app requires a MongoDB database to work.
Get a precompiled package from http://www.mongodb.org, unzip and create a "data" directory. then run "mongod --dbpath ./data" from the bin dir (use your 'data' path).
Sometimes Node.js stacktraces are cryptic.
If you meant to say "my Windows system" and you have built a WIN32 version of node, then it is likely that the permissions related code has not yet been implemented.
I suggest that you try the Cygwin version. I have sucessfully built 0.5.0pre on Cygwin. If you don't have Cygwin, it is easy to install on XP or Win7. You don't need all of it, just the base install and the packages mentioned here: https://github.com/ry/node/wiki/Building-node.js-on-Cygwin-(Windows)