Uncaught Error: Cannot find module 'stream' - meteor

Upon upgrading from Reaction Commerce v1.21.1 to v1.13.0 (which uses Meteor 1.7.0.1) I started getting the following stream error:
modules-runtime.js?hash=59942621baf2d3ff23916a0f601008fd2e310b63:241 Uncaught Error: Cannot find module 'stream'
at makeMissingError (modules-runtime.js?hash=59942621baf2d3ff23916a0f601008fd2e310b63:241)
at require (modules-runtime.js?hash=59942621baf2d3ff23916a0f601008fd2e310b63:251)
at bunyan.js (modules.js?hash=e8f82e706d01284fec46024b7d677bc1323d896a:47108)
at fileEvaluate (modules-runtime.js?hash=59942621baf2d3ff23916a0f601008fd2e310b63:349)
at require (modules-runtime.js?hash=59942621baf2d3ff23916a0f601008fd2e310b63:248)
at main.js (modules.js?hash=e8f82e706d01284fec46024b7d677bc1323d896a:46804)
at fileEvaluate (modules-runtime.js?hash=59942621baf2d3ff23916a0f601008fd2e310b63:349)
at require (modules-runtime.js?hash=59942621baf2d3ff23916a0f601008fd2e310b63:248)
at index.js (index.js:1)
at fileEvaluate (modules-runtime.js?hash=59942621baf2d3ff23916a0f601008fd2e310b63:349)
I did an rc reset -y (equivalent to meteor reset) deleting all node_modules and installing anew. Alas, this attempt did not prevail.
I then found this Stack Overflow answer and tried reinstalling Meteor with the meteor install script, no to avail:
https://stackoverflow.com/a/13314141/1762493
Here's my code:
https://github.com/MassDistributionMedia/rc-ca-blinds/tree/feature/version/rc1.13.0-dev1

I fixed this by using yarn instead of npm install on Meteor 1.8.0.2.
https://github.com/meteor/meteor/issues/10451

Related

Meteor build fails when run back to back

I'm trying to learn about the Meteor build process to improve it's performance for my dockerized Meteor app. I'm finding that if I run meteor build build --directory --server-only twice, back to back, I get an error about not being able to parse json on the second run.
Here's the successful first run:
❯❯❯ meteor build build --directory --server-only
WARNING: The output directory is under your source tree.
Your generated files may get interpreted as source code!
Consider building into a different directory instead
meteor build ../output
WARNING: npm peer requirements (for juliancwirko:postcss) not installed:
- postcss#8.2.6 installed, postcss#^7.0.0 needed
- postcss-load-config#3.0.1 installed, postcss-load-config#^2.1.0 needed
Read more about installing npm peer dependencies:
http://guide.meteor.com/using-packages.html#peer-npm-dependencies
Minifying app stylesheet /
Replace Autoprefixer browsers option to Browserslist config.
Use browserslist key in package.json or .browserslistrc file.
Using browsers option can cause errors. Browserslist config can
be used for Babel, Autoprefixer, postcss-normalize and other tools.
If you really need to use option, rename it to overrideBrowserslist.
Learn more at:
https://github.com/browserslist/browserslist#readme
https://twitter.com/browserslist
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Minifying app code \
and here's the unsuccessful second run. Note that I didn't do anything inbetween runs:
❯❯❯ meteor build build --directory --server-only
WARNING: The output directory is under your source tree.
Your generated files may get interpreted as source code!
Consider building into a different directory instead
meteor build ../output
WARNING: npm peer requirements (for juliancwirko:postcss) not installed:
- postcss#8.2.6 installed, postcss#^7.0.0 needed
- postcss-load-config#3.0.1 installed, postcss-load-config#^2.1.0 needed
Read more about installing npm peer dependencies:
http://guide.meteor.com/using-packages.html#peer-npm-dependencies
/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:
218
throw error;
^
SyntaxError: Unexpected token u in JSON at position 1
at JSON.parse (<anonymous>)
at /home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/optimistic.ts:321:17
at wrap.makeCacheKey (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/optimistic.ts:36:
15)
at recomputeNewValue (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimis
m/src/entry.ts:182:31)
at Slot.withValue (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/#wry/conte
xt/lib/context.js:73:29)
at reallyRecompute (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimism/
src/entry.ts:165:19)
at Entry.recompute (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimism/
src/entry.ts:85:9)
at optimistic (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimism/src/i
ndex.ts:101:25)
at /home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/optimistic.ts:366:19
at recomputeNewValue (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimis
m/src/entry.ts:182:31)
at Slot.withValue (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/#wry/conte
xt/lib/context.js:73:29)
at reallyRecompute (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimism/
src/entry.ts:165:19)
at Entry.recompute (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimism/
src/entry.ts:85:9)
at optimistic (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimism/src/i
ndex.ts:101:25)
at find (/tools/isobuild/package-source.js:1339:30)
at /tools/isobuild/package-source.js:1395:27
at Array.forEach (<anonymous>)
at find (/tools/isobuild/package-source.js:1374:22)
at find (/tools/isobuild/package-source.js:1406:25)
at /tools/isobuild/package-source.js:1395:27
at Array.forEach (<anonymous>)
at find (/tools/isobuild/package-source.js:1374:22)
at /tools/isobuild/package-source.js:1395:27
at Array.forEach (<anonymous>)
at find (/tools/isobuild/package-source.js:1374:22)
at /tools/isobuild/package-source.js:1395:27
at Array.forEach (<anonymous>)
at find (/tools/isobuild/package-source.js:1374:22)
at /tools/isobuild/package-source.js:1395:27
at Array.forEach (<anonymous>)
at find (/tools/isobuild/package-source.js:1374:22)
at /tools/isobuild/package-source.js:1395:27
at Array.forEach (<anonymous>)
at find (/tools/isobuild/package-source.js:1374:22)
at /tools/isobuild/package-source.js:1418:34
at Object.withCache (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1663:18)
at PackageSource._findSources (/tools/isobuild/package-source.js:1418:18)
at SourceArch.getFiles (/tools/isobuild/package-source.js:960:32)
at /tools/isobuild/compiler.js:406:23
at /tools/isobuild/compiler.js:186:28
at Object.withCache (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1663:18)
at /tools/isobuild/compiler.js:185:11
at Function._.each._.forEach (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules
/underscore/underscore.js:186:9)
at Object.compile (/tools/isobuild/compiler.js:180:5)
at /tools/isobuild/bundler.js:3268:24
at Object.capture (/tools/utils/buildmessage.js:283:5)
at bundle (/tools/isobuild/bundler.js:3214:31)
at /tools/isobuild/bundler.js:3157:32
at Slot.withValue (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/#wry/conte
xt/lib/context.js:73:29)
at Object.withCache (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1663:39)
at Object.bundle (/tools/isobuild/bundler.js:3157:16)
at buildCommand (/tools/cli/commands.js:1082:30)
at /tools/cli/commands.js:945:25
at Function.run (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/tool-env/tools/tool-env/profile.ts
:289:14)
at /tools/cli/commands.js:943:18
at /home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/fiber_pool.
js:43:40
=> awaited here:
at Promise.await (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-prom
ise/promise_server.js:60:12)
at /tools/cli/main.js:1529:7
I've also tried doing the second run with a different directory output, but get the same result:
❯❯❯ meteor build .. --directory --server-only
WARNING: npm peer requirements (for juliancwirko:postcss) not installed:
- postcss#8.2.6 installed, postcss#^7.0.0 needed
- postcss-load-config#3.0.1 installed, postcss-load-config#^2.1.0 needed
Read more about installing npm peer dependencies: http://guide.meteor.com/using-packages.html#peer-npm-dependencies
/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:
218
throw error;
^
SyntaxError: Unexpected token u in JSON at position 1
at JSON.parse (<anonymous>)
Why does meteor fail to build if I try to build it twice back to back?
What happens is that you produce your built app but not bundle it (using the --directory flag).
Therefore you have extra JS files in your file structure.
And in your attempts, they are mixed with your Meteor project structure, in a build folder (when you use command meteor build build --directory) or directly merged (meteor build .. --directory).
Therefore, on the next build run, Meteor picks these extra JS files as if they were part of your source code (eager loading), and fails, as suggested in the warning message:
The output directory is under your source tree.
Your generated files may get interpreted as source code!
Consider building into a different directory instead
meteor build ../output
It would have worked in your next attempt if you had specified an explicit sibling build folder, instead of just the parent folder (which therefore puts files directly in your Meteor project root), e.g. meteor build ../siblingFolder
Another possible workaround is to use a build folder name starting with a dot ., so that Meteor ignores it on the next runs when it looks for source code, e.g. meteor build ./.build
See special directories docs:
The following directories are also not loaded as part of your app code:
Files/directories whose names start with a dot, like .meteor and .git

Sails grunt watch - Warning: Cannot read property 'bigint' of undefined Use --force to continue

I run sails on current project, just copied current project to new macbook high sierra and suddenly shown this error when running task grunt and edit asset files.
Sails version: 1.0.2
Grunt-cli version: 1.2.0
Grunt version: 1.0.3
Npm vesion: 6.1.0
Running "watch" task
Waiting...
>> File "assets/styles/project/_colors.scss" changed.
Running "less:dev" (less) task
>> 1 stylesheet created.
Running "sass:dev" (sass) task
Running "sync:dev" (sync) task
**Warning: Cannot read property 'bigint' of undefined Use --force to continue.**
When i run trace for this problem will show this
Warning: Cannot read property 'bigint' of undefined Use --force to continue.
TypeError: Cannot read property 'bigint' of undefined
at Object.stat (fs.js:795:37)
at Object.stat (/Users/erwinsetiawan/Works/Project/review-portal/node_modules/sails-hook-grunt/node_modules/promised-io/promise.js:709:17)
at processPair (/Users/erwinsetiawan/Works/Project/review-portal/node_modules/sails-hook-grunt/node_modules/grunt-sync/tasks/sync.js:143:28)
at /Users/erwinsetiawan/Works/Project/review-portal/node_modules/sails-hook-grunt/node_modules/grunt-sync/tasks/sync.js:52:16
at Array.map (<anonymous>:null:null)
at Object.<anonymous> (/Users/erwinsetiawan/Works/Project/review-portal/node_modules/sails-hook-grunt/node_modules/grunt-sync/tasks/sync.js:37:38)
at Array.map (<anonymous>:null:null)
at Object.<anonymous> (/Users/erwinsetiawan/Works/Project/review-portal/node_modules/sails-hook-grunt/node_modules/grunt-sync/tasks/sync.js:29:28)
at Object.<anonymous> (/Users/erwinsetiawan/Works/Project/review-portal/node_modules/grunt/lib/grunt/task.js:252:15)
at Object.thisTask.fn (/Users/erwinsetiawan/Works/Project/review-portal/node_modules/grunt/lib/grunt/task.js:70:16)
at Object.<anonymous> (/Users/erwinsetiawan/Works/Project/review-portal/node_modules/grunt/lib/util/task.js:294:30)
at Task.runTaskFn (/Users/erwinsetiawan/Works/Project/review-portal/node_modules/grunt/lib/util/task.js:244:24)
at Task.<anonymous> (/Users/erwinsetiawan/Works/Project/review-portal/node_modules/grunt/lib/util/task.js:293:12)
at /Users/erwinsetiawan/Works/Project/review-portal/node_modules/grunt/lib/util/task.js:220:11
at process._tickCallback (internal/process/next_tick.js:61:11)
It nothing happen when run this project to another laptop old el capitan and windows
Anyone can help me to solve di problem?
This appears to be fixed in grunt-sync 0.8.0. I suggest updating the grunt-sync package.
This is now fixed in sails-hook-grunt#4.0.1 (see https://github.com/balderdashy/sails/issues/4470 for more information)
Downgrade from node 10.5.0 to node 10.4.1 fix this problem, so probably current grunt version not yet supported the newest node version.

Potential conflict between polymer build and tur-nr/polymer-redux

Description
I am experiencing unexpected errors when running polymer build after installing and using tur-nr/polymer-redux. Here is the demo repo.
Versions & Environment
polymer-build: v0.18.3 polymer --version
node: v6.10.2
Operating System: macOS Sierra v10.12.4
Steps to reproduce
terminal
git clone https://github.com/maria-le/redux # clone remote repo to your local
cd redux # cd into your local repo
bower install # install bower dependencies
npm install redux # install redux
polymer build # attempt build
Expected results
I expect the build to complete, without errors. Then allow me to serve the packaged build.
Actual results
I get the following errors in the terminal.
Error messages
src/all-locally.html(14,16) error [unknown-polymer-behavior] - Unable to resolve behavior store. Did you import it? Is it annotated with #polymerBehavior?
ReduxStore
src/imported-behavior.html(7,16) error [unknown-polymer-behavior] - Unable to resolve behavior ReduxStore. Did you import it? Is it annotated with #polymerBehavior?
polymerStore
src/imported-store-as-variable.html(10,16) error [unknown-polymer-behavior] - Unable to resolve behavior polymerStore. Did you import it? Is it annotated with #polymerBehavior?
PolymerRedux(reduxStore)
src/imported-store.html(7,16) warning [could-not-determine-behavior-name] - Could not determine behavior name from expression of type
CallExpression
error: Promise rejection: Error: 3 error(s) occurred during build.
error: Error: 3 error(s) occurred during build.
at BuildAnalyzer._done (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:229:36)
at BuildAnalyzer. (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:189:26)
at next (native)
at fulfilled (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:17:58)
at process._tickCallback (internal/process/next_tick.js:109:7)
References
How to use polymer-redux with polymer-build?
polymer lint and polymer-build fail due to ReduxBehavior not registering properly
#polymerBehavior should still produce a behavior even if we can't evaluate the expression

Couldn't get laika to work on meteor

I'm using meteor 0.6.4, node 0.10.12 and laika 0.2.8. I followed the instructions on the getting started page and I get this error:
injecting laika...
loading phantomjs...
cleaning up injected code
/Users/camilo/.nvm/v0.10.12/lib/node_modules/laika/lib/app.js:124
if(err) throw err;
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
I switched to laika 0.2.4 based on this question Fail to run laika framework for meteor and get the same error.
Edit
I'm using phantomjs 1.9.1 installed with homebrew
Edit 2
I updated laika to 0.2.13 and tried with mrt (I was using meteor) but now the problem is different. With laika -D I get this:
[laika log] accepting the following extensions: (js)
injecting laika...
loading phantomjs...
[app touch log]
[app touch log] Stand back while Meteorite does its thing
[app touch log]
[app touch log] Done installing smart packages
[app touch log] Ok, everything's ready. Here comes Meteor!
[app touch log] [[[[[ ~/Documents/Pruebas/Meteor/test ]]]]]
[app touch log] => Meteor server running on: http://localhost:25969/
After a while, this error appear:
phantom stderr:
phantom stderr: child_process.js:927
throw errnoException(process._errno, 'spawn');
^
Error: spawn EAGAIN
at errnoException (child_process.js:980:11)
at ChildProcess.spawn (child_process.js:927:11)
at exports.spawn (child_process.js:715:9)
at Object.<anonymous> (/Users/camilo/.nvm/v0.10.12/lib/node_modules/phantomjs/bin/phantomjs: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)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
phantom crash: code 8
I uninstalled phantomjs, put the phantomjs binary on the same project folder and tested again but get the same error.
After many attempts, apparently the problem was with phantomjs. Installing it with homebrew or putting the binary directly on the project doesn't work for me. After update laika to 0.2.14 and install phantomjs with sudo npm install -g phantomjs it worked.
This is not a phantomjs basic issue. But a issue with nodejs version used by laika.
Please update laika to 0.2.13 and run laika -D which gives some verbose logs. lets talk about after that.
Normally, if your project runs with meteor (not mrt), laika uses binary located at following location.
~/.meteor/tools/latest/bin/node

Is Meteor running from the wrong path?

I have just installed Meteor from the auth branch. Meteor seems to read its content from /usr/lib/meteor - But it was installed to /usr/local/meteor. /usr/local/meteor/packages contains all packages i need but when i list packages from terminal it shows the default ones. I'm trying to run a project i recently created on another computer:
Errors prevented startup:
Exception while bundling application:
Error: The package named accounts-ui does not exist.
at _.extend.init_from_library (/usr/lib/meteor/app/lib/packages.js:91:13)
at Object.module.exports.get (/usr/lib/meteor/app/lib/packages.js:225:11)
at self.api.use (/usr/lib/meteor/app/lib/bundler.js:83:28)
at Array.forEach (native)
at Function._.each._.forEach (/usr/lib/meteor/app/lib/third/underscore.js:76:11)
at Object.self.api.use (/usr/lib/meteor/app/lib/bundler.js:82:9)
at _.extend.init_from_app_dir [as on_use] (/usr/lib/meteor/app/lib/packages.js:136:11)
at _.extend.use (/usr/lib/meteor/app/lib/bundler.js:362:11)
at Object.exports.bundle (/usr/lib/meteor/app/lib/bundler.js:649:12)
at exports.run.restart_server (/usr/lib/meteor/app/meteor/run.js:509:26)
Your application is crashing. Waiting for file change.
My first thought was that some 'Meteor-path-variable' was set wrong, but i cant find something like that.
Solved - Restarted the computer..

Resources