grunt + bower task gives fatal error: Unexpected token { - gruntjs

I know these are too old environments but still using..
When I run grunt, the fatal error happens.
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/var/application/staging.retrip.jp/node_modules/bower-registry-client/node_modules/request/lib/cookies.js:3:13)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
I'm not familiar with grunt + bower task..
Please help..

Related

How to resolve error running grunt command after grunt-cli installation?

I am new to grunt and after installing grunt-cli, wanted to try a simple command "grunt --help" and getting following error,
C:\Users\USER01>grunt --help
C:\Users\USER01\AppData\Roaming\npm\node_modules\grunt-cli\node_modules\liftup\node_modules\findup-sync\node_modules\micromatch\index.js:3
const util = require('util');
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
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> (C:\Users\USER01\AppData\Roaming\npm\node_modules\grunt-cli\node_modules\liftup\node_modules\findup-sync\index.js:12:10)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
Additional Info :
C:\Users\USER01>npm --version
1.4.9
C:\Users\USER01>node --version
v0.10.28
Any clues would be appreciated.
Thanks,
SK

Meteor build TypeError: module.import is not a function

In the last couple of days I have been having trouble building. I moved to Meteor 1.4.2, and I'm not sure if that is the problem. I tried going back to Meteor 1.4.1.3 but the problem is still there
The error I am getting is
W20161108-11:17:17.631(11)? (STDERR) /Users/mikkel/senecto/memberapp/.meteor/local/build/programs/server/boot.js:333
W20161108-11:17:17.632(11)? (STDERR) }).run();
W20161108-11:17:17.632(11)? (STDERR) ^
W20161108-11:17:17.632(11)? (STDERR)
W20161108-11:17:17.632(11)? (STDERR) TypeError: module.import is not a function
W20161108-11:17:17.633(11)? (STDERR) at meteorInstall.node_modules.meteor.webapp.webapp_server.js (/Users/mikkel/senecto/memberapp/.meteor/local/build/programs/server/packages/webapp.js:33:26)
W20161108-11:17:17.633(11)? (STDERR) at fileEvaluate (packages/modules-runtime/packages/modules-runtime.js:171:1)
W20161108-11:17:17.633(11)? (STDERR) at require (packages/modules-runtime/packages/modules-runtime.js:96:1)
W20161108-11:17:17.633(11)? (STDERR) at /Users/mikkel/senecto/memberapp/.meteor/local/build/programs/server/packages/webapp.js:842:1
W20161108-11:17:17.633(11)? (STDERR) at /Users/mikkel/senecto/memberapp/.meteor/local/build/programs/server/packages/webapp.js:855:3
W20161108-11:17:17.633(11)? (STDERR) at /Users/mikkel/senecto/memberapp/.meteor/local/build/programs/server/boot.js:292:10
W20161108-11:17:17.633(11)? (STDERR) at Array.forEach (native)
W20161108-11:17:17.634(11)? (STDERR) at Function._.each._.forEach (/Users/mikkel/.meteor/packages/meteor-tool/.1.4.1_3.89kw9a++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20161108-11:17:17.634(11)? (STDERR) at /Users/mikkel/senecto/memberapp/.meteor/local/build/programs/server/boot.js:128:5
=> Exited with code: 1
I don't understand what is wrong, meteor reset has no effect, not does removing the build directory.
Any ideas please?
As confirmed in the comments, deleting ~/.meteor resolves this issue. When this directory is deleted, Meteor will reinstall all packages, incl. core packages.

Meteor - how to deal with npm peer requirements not installed?

I have a Meteor application (1.3.2.4) and when I run it I get:
WARNING: npm peer requirements not installed:
react#15.3.1 installed, react#0.14.x needed
react-addons-update#15.3.1 installed, react-addons-update#0.14.x needed
react-addons-pure-render-mixin#15.3.1 installed, react-addons-pure-render-mixin#0.14.x needed
Read more about installing npm peer dependencies:
http://guide.meteor.com/using-packages.html#peer-npm-dependencies
/home/tidee/.meteor/packages/meteor-tool/.1.3.2_4.17uhn8z++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:267
throw(ex);
^
Error: Cannot find module 'react/lib/ReactDefaultPerf'
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> (/tidee/app/tidee-meteor/node_modules/react-addons-perf/index.js:1:18)
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)
In my package.json file in the root of the application I have the following dependency:
"react": "^15.0.1"
So, where is 15.3.1 coming from - is Meteor installing it?
Secondly, it's not telling me which other npm packages require a lower version of React to be installed - how do I find this out?

Meteor keeps failing after update

I first get:
=> Started proxy.
=> Started MongoDB.
Unable to resolve some modules:
"./cancel.js" in /Users/abc123/Google Drive/Code/Meteor/canary/node_modules/bluebird/js/main/promise.js (os.osx.x86_64)
I20160830-00:34:12.965(-4)? ** You've set up some data subscriptions with Meteor.publish(), but
I20160830-00:34:13.022(-4)? ** you still have autopublish turned on. Because autopublish is still
I20160830-00:34:13.023(-4)? ** on, your Meteor.publish() calls won't have much effect. All data
I20160830-00:34:13.023(-4)? ** will still be sent to all clients.
I20160830-00:34:13.023(-4)? **
I20160830-00:34:13.023(-4)? ** Turn off autopublish by removing the autopublish package:
I20160830-00:34:13.024(-4)? **
I20160830-00:34:13.024(-4)? ** $ meteor remove autopublish
I20160830-00:34:13.024(-4)? **
I20160830-00:34:13.024(-4)? ** .. and make sure you have Meteor.publish() and Meteor.subscribe() calls
I20160830-00:34:13.025(-4)? ** for each collection that you want clients to see.
It Then gives a later error:
W20160830-00:34:25.614(-4)? (STDERR) /Users/abc123/.meteor/packages/meteor-tool/.1.4.1_1.6uhwa8++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20160830-00:34:25.615(-4)? (STDERR) throw(ex);
W20160830-00:34:25.615(-4)? (STDERR) ^
W20160830-00:34:25.615(-4)? (STDERR)
W20160830-00:34:25.616(-4)? (STDERR) Error: Cannot find module './cancel.js'
W20160830-00:34:25.616(-4)? (STDERR) at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:85:1)
W20160830-00:34:25.616(-4)? (STDERR) at module.exports (node_modules/bluebird/js/main/promise.js:714:1)
W20160830-00:34:25.619(-4)? (STDERR) at meteorInstall.node_modules.bluebird.js.main.bluebird.js (node_modules/bluebird/js/main/bluebird.js:9:1)
W20160830-00:34:25.619(-4)? (STDERR) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
W20160830-00:34:25.619(-4)? (STDERR) at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
W20160830-00:34:25.619(-4)? (STDERR) at meteorInstall.node_modules.stripe.lib.StripeResource.js (node_modules/stripe/lib/StripeResource.js:6:1)
W20160830-00:34:25.619(-4)? (STDERR) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
W20160830-00:34:25.620(-4)? (STDERR) at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
W20160830-00:34:25.620(-4)? (STDERR) at meteorInstall.node_modules.stripe.lib.resources.Accounts.js (node_modules/stripe/lib/resources/Accounts.js:3:1)
W20160830-00:34:25.620(-4)? (STDERR) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
W20160830-00:34:25.620(-4)? (STDERR) at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
W20160830-00:34:25.621(-4)? (STDERR) at meteorInstall.node_modules.stripe.lib.stripe.js (node_modules/stripe/lib/stripe.js:28:1)
W20160830-00:34:25.621(-4)? (STDERR) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
W20160830-00:34:25.621(-4)? (STDERR) at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
W20160830-00:34:25.621(-4)? (STDERR) at meteorInstall.server.stripe.js (server/stripe.js:1:10)
W20160830-00:34:25.621(-4)? (STDERR) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
Anyone have any ideas of what to try or rule out?
meteor --version
Meteor 1.4.1.1
Turned out that the Stripe module I had in my imports was not updated and had caused the crash. Removing it solved the issue.

Runtime error when running meteor

I did a meteor install for the first time a week ago. Everything worked like a charm.
Today I open up a terminal and tried typing meteor and get:
module.js:117
throw e;
^
SyntaxError: Error parsing /home/mike/.meteor/tools/0b2f28e18b/lib/node_modules/fibers/package.json: Unexpected end of input
at Object.parse (native)
at readPackage (module.js:113:48)
at tryPackage (module.js:123:13)
at Function.Module._findPath (module.js:190:18)
at Function.Module._resolveFilename (module.js:336:25)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/mike/.meteor/tools/0b2f28e18b/tools/meteor.js:6:13)
at Module._compile (module.js:456:26)
I assumed that somehow meteor was messed up. so I tried to reinstall it and get:
module.js:117
throw e;
^
SyntaxError: Error parsing /home/mike/.meteor/tools/0b2f28e18b/lib/node_modules/fibers/package.json: Unexpected end of input
at Object.parse (native)
at readPackage (module.js:113:48)
at tryPackage (module.js:123:13)
at Function.Module._findPath (module.js:190:18)
at Function.Module._resolveFilename (module.js:336:25)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/mike/.meteor/tools/0b2f28e18b/tools/meteor.js:6:13)
at Module._compile (module.js:456:26)
How do I fix my meteor install?

Resources