Draft-js: Unable to build draft-js examples

Created on 4 Jan 2017  路  13Comments  路  Source: facebook/draft-js

Trying to build draft-js examples...
in Ubuntu 14 with nodev4.2.6
got this error while build

[email protected] build /home/ubuntu/draft-js-0.10-stable
gulp

[11:09:11] Using gulpfile ~/draft-js-0.10-stable/gulpfile.js
[11:09:11] Starting 'default'...
[11:09:11] Starting 'check-dependencies'...
[11:09:15] 'check-dependencies' errored after 3.5 s
[11:09:15] Error in plugin 'check-dependencies'
Message:
npm broke
[11:09:15] 'default' errored after 3.5 s
[11:09:15] Error in plugin 'run-sequence(check-dependencies)'
Error
at finish (/home/ubuntu/draft-js-0.10-stable/node_modules/run-sequence/index.js:56:13)
at Gulp.onError (/home/ubuntu/draft-js-0.10-stable/node_modules/run-sequence/index.js:67:4)
at emitOne (events.js:82:20)
at Gulp.emit (events.js:169:7)
at Gulp.Orchestrator._emitTaskDone (/home/ubuntu/draft-js-0.10-stable/node_modules/orchestrator/index.js:264:8)
at /home/ubuntu/draft-js-0.10-stable/node_modules/orchestrator/index.js:275:23
at finish (/home/ubuntu/draft-js-0.10-stable/node_modules/orchestrator/lib/runTask.js:21:8)
at DestroyableTransform. (/home/ubuntu/draft-js-0.10-stable/node_modules/orchestrator/lib/runTask.js:52:4)
at DestroyableTransform.f (/home/ubuntu/draft-js-0.10-stable/node_modules/end-of-stream/node_modules/once/once.js:17:25)
at emitOne (events.js:82:20)

npm ERR! Linux 3.13.0-106-generic
npm ERR! argv "/home/ubuntu/node-v4.2.6-linux-x64/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v4.2.6
npm ERR! npm v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: gulp
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'gulp'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the draft-js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! gulp
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs draft-js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls draft-js
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/draft-js-0.10-stable/npm-debug.log

Most helpful comment

Build failed with node version 6.9.1 and npm 4.1.1. Downgrade npm to version 3.10.10 and get working now.

npm install [email protected] -g

Notice devEngines specified in package.json as follows:

  "devEngines": {
    "node": "4.x || 6.x",
    "npm": "2.x || 3.x"
  },

All 13 comments

I have the same problem on Mac OSX, where node and npm are installed and updated with brew:
npm ERR! node v7.3.0 npm ERR! npm v4.0.5

strange. i just tried, with node v6.3.1/nvm v3.10.3 and couldn't repro..

I also have the same problem with node v7.4.0 & npm v4.0.5

I get the same with v7.4.0 but if I downgrade to v6.9.4 everything works fine.

The error can be traced down to npm outdated --json --long returning 0 in version 6 and for some reason 1 in version 7. This can be found in https://github.com/facebook/fbjs/blob/master/packages/fbjs-scripts/gulp/check-dependencies.js#L38

Issue posted here: https://github.com/facebook/fbjs/issues/213

I have the same:

$ npm run build

> [email protected] build /Users/jeremy/Documents/Programming/draft-js
> gulp

[02:06:30] Using gulpfile ~/Documents/Programming/draft-js/gulpfile.js
[02:06:30] Starting 'default'...
[02:06:30] Starting 'check-dependencies'...
[02:06:32] 'check-dependencies' errored after 2.35 s
[02:06:32] Error in plugin 'check-dependencies'
Message:
    npm broke
[02:06:32] 'default' errored after 2.36 s
[02:06:32] Error in plugin 'run-sequence(check-dependencies)'
Error
    at finish (/Users/jeremy/Documents/Programming/draft-js/node_modules/run-sequence/index.js:56:13)
    at Gulp.onError (/Users/jeremy/Documents/Programming/draft-js/node_modules/run-sequence/index.js:67:4)
    at emitOne (events.js:101:20)
    at Gulp.emit (events.js:188:7)
    at Gulp.Orchestrator._emitTaskDone (/Users/jeremy/Documents/Programming/draft-js/node_modules/orchestrator/index.js:264:8)
    at /Users/jeremy/Documents/Programming/draft-js/node_modules/orchestrator/index.js:275:23
    at finish (/Users/jeremy/Documents/Programming/draft-js/node_modules/orchestrator/lib/runTask.js:21:8)
    at DestroyableTransform.<anonymous> (/Users/jeremy/Documents/Programming/draft-js/node_modules/orchestrator/lib/runTask.js:52:4)
    at DestroyableTransform.f (/Users/jeremy/Documents/Programming/draft-js/node_modules/end-of-stream/node_modules/once/once.js:17:25)
    at emitOne (events.js:101:20)

npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.9.4
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `gulp`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script 'gulp'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the draft-js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs draft-js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls draft-js
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/jeremy/Documents/Programming/draft-js/npm-debug.log

Build failed with node version 6.9.1 and npm 4.1.1. Downgrade npm to version 3.10.10 and get working now.

npm install [email protected] -g

Notice devEngines specified in package.json as follows:

  "devEngines": {
    "node": "4.x || 6.x",
    "npm": "2.x || 3.x"
  },

same error with node: 7.4.0 & npm:4.1.2;
working with node: 6.9.4 & npm 3.10.10;

node 7.3.0 and npm 3.10.10 was safe too.

I had the same problem, I just downgraded node to 6.9.4 with n and it works like a charm after.

node: 6.9.4
npm: 3.10.10

Edited my local /fbjs-scripts/gulp/check-dependencies.js L38 to

  • if (code !== 0 && code !== 1) {

and changed package.json

  • "devEngines": {
    "node": "4.x || 6.x || 7.x",
    "npm": "2.x || 3.x || 4.x"
    },

was able to run the package.json scripts

Was unable to run the webside folder project in Windows 10, "npm start" errored out. Got it working on
the Windows 10 Bash Shell Linex with

This is happening because of a change to the exit code of npm outdated. In addition to introducing a breaking change in 7.0, (see here), a feature of said change which was suppose to allow for the old behavior was unintentionally left unimplemented.

This bug is a knock on effect from a bug in NPM which in turn causes a bug in fbjs-scripts/gulp/check-dependencies. Solutions are either to fix the bug in NPM or this one in check dependencies.

I downgrade npm every time I need to build a new version of draft-js. Nice job, FB.

it's 2020 now and I'm reading comments from 3 years ago. 馃槙

Was this page helpful?
0 / 5 - 0 ratings