reactioncommerce / reaction-cli

A command line tool for working with Reaction Commerce.
33 stars 20 forks source link

FATAL ERROR: JS Allocation failed - process out of memory #26

Closed larsmaultsby closed 7 years ago

larsmaultsby commented 7 years ago

`$ reaction init

Cloning the master branch of Reaction from Github... Cloning into 'reaction'...

Installing NPM packages... Refreshing package metadata. This may take a moment. FATAL ERROR: JS Allocation failed - process out of memory /bin/sh: line 1: 4715 Abort trap: 6 meteor npm install

Error: Node modules were not successfully installed. Exiting.`

jshimko commented 7 years ago

Please provide details of your machine.

reaction -v

Does this error happen every time you run the command?

larsmaultsby commented 7 years ago

OSX 10.11 8GB ram

$ reaction -v Node: 4.1.1 NPM: 3.10.9 Reaction CLI: 0.8.0

Yeah, it happens everytime.

jshimko commented 7 years ago

Can you try updating Node? The 4.x line is at 4.8.2 now, so you're pretty far behind on that.

Your npm is pretty out of date too. The npm install that's failing for you is using the npm version that's bundled with Meteor, so updating your global npm won't fix this problem, but you should definitely still do it. However, the global Node version you have is what runs the CLI, so that's possibly related to your issue.

To update npm...

npm i -g npm

To update Node...

npm i -g n

n stable
larsmaultsby commented 7 years ago

I used nvm to switch to the latest stable version.

$ reaction -v

Node: 6.9.5
NPM: 3.10.10
Reaction CLI: 0.8.0

I'm getting the same error.

larsmaultsby commented 7 years ago

actually, just realized that's not hte latest stable. Will install and try again.

jshimko commented 7 years ago

Can you update npm and run npm install in the Reaction directory? 4.5.0 is the latest version of npm.

larsmaultsby commented 7 years ago

same error

Installing NPM packages...
Refreshing package metadata. This may take a moment.
FATAL ERROR: JS Allocation failed - process out of memory
/bin/sh: line 1:  6882 Abort trap: 6           meteor npm install

Error: Node modules were not successfully installed. Exiting.
$ reaction -v

Node: 7.9.0
NPM: 4.2.0
Reaction CLI: 0.8.0
larsmaultsby commented 7 years ago

sure

larsmaultsby commented 7 years ago
$ reaction -v

Node: 7.9.0
NPM: 4.5.0
Reaction CLI: 0.8.0

Same error :(

jshimko commented 7 years ago

And you tried running npm install from the Reaction directory manually?

larsmaultsby commented 7 years ago

That works.

larsmaultsby commented 7 years ago
$ reaction -v

Node: 7.9.0
NPM: 4.5.0
Reaction CLI: 0.8.0
Reaction: 1.1.1
Reaction Branch: master
$ reaction

Using settings file at settings/dev.settings.json

Setting up plugin imports...

Setting up style imports...

Refreshing package metadata. This may take a moment.
FATAL ERROR: JS Allocation failed - process out of memory
/private/var/folders/fv/6g26tw252h3815r8yv7hx2mc0000gn/T/shelljs_77824a04c5fdf6ca09cd:10
    fs.writeFileSync(fname, err.code.toString());
                                    ^

TypeError: Cannot read property 'toString' of null
    at /private/var/folders/fv/6g26tw252h3815r8yv7hx2mc0000gn/T/shelljs_77824a04c5fdf6ca09cd:10:37
    at ChildProcess.exithandler (child_process.js:212:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at Pipe._handle.close [as _onclose] (net.js:510:12)
exec: internal error
larsmaultsby commented 7 years ago

I'm wondering if it's related to nvm.

jshimko commented 7 years ago

Can you try prepending the failing commands with the following Node flag?

# init 
NODE_OPTIONS="--max_old_space_size=4096" reaction init

# run
NODE_OPTIONS="--max_old_space_size=4096" reaction
larsmaultsby commented 7 years ago
$ NODE_OPTIONS="--max_old_space_size=4096" reaction init

Cloning the master branch of Reaction from Github...
Cloning into 'reaction'...

Installing NPM packages...
Refreshing package metadata. This may take a moment.
FATAL ERROR: JS Allocation failed - process out of memory
/bin/sh: line 1: 10660 Abort trap: 6           meteor npm install

Error: Node modules were not successfully installed. Exiting.

After npm install:

$ NODE_OPTIONS="--max_old_space_size=4096" reaction

Using settings file at settings/dev.settings.json

Setting up plugin imports...

Setting up style imports...

Refreshing package metadata. This may take a moment.
FATAL ERROR: JS Allocation failed - process out of memory
/private/var/folders/fv/6g26tw252h3815r8yv7hx2mc0000gn/T/shelljs_eb2638c5c67d71f2a9f4:10
    fs.writeFileSync(fname, err.code.toString());
                                    ^

TypeError: Cannot read property 'toString' of null
    at /private/var/folders/fv/6g26tw252h3815r8yv7hx2mc0000gn/T/shelljs_eb2638c5c67d71f2a9f4:10:37
    at ChildProcess.exithandler (child_process.js:212:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at Pipe._handle.close [as _onclose] (net.js:510:12)
exec: internal error
larsmaultsby commented 7 years ago

I had a prior version of meteor installed. Once I removed and reinstalled I was able to get everything to work.