i cant get the example to run
i am on linux ubuntu 15.10
> $ npm install
> [email protected] prepublish /home/mod/code/test/react-native/relay/scripts/babel-relay-plugin
> npm run build
> [email protected] build /home/mod/code/test/react-native/relay/scripts/babel-relay-plugin
> node scripts/build-lib
module.js:328
throw err;
^
Error: Cannot find module 'glob'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/mod/code/test/react-native/relay/scripts/babel-relay-plugin/scripts/build-lib:6:14)
at Module._compile (module.js:398:26)
at Object.Module._extensions..js (module.js:405:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:430:10)
npm ERR! Linux 4.2.0-27-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v5.4.0
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `node scripts/build-lib`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'node scripts/build-lib'.
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 babel-relay-plugin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build-lib
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs babel-relay-plugin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls babel-relay-plugin
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /home/mod/code/test/react-native/relay/scripts/babel-relay-plugin/npm-debug.log
npm ERR! addLocal Could not install /home/mod/code/test/react-native/relay/scripts/babel-relay-plugin
> [email protected] prepublish /home/mod/code/test/react-native/relay
> node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && npm run build
module.js:328
throw err;
^
Error: Cannot find module '/home/mod/code/test/react-native/relay/node_modules/fbjs-scripts/node/check-dev-engines.js'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Function.Module.runMain (module.js:430:10)
at startup (node.js:141:18)
at node.js:1003:3
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! addLocal Could not install /home/mod/code/test/react-native/relay
npm ERR! Linux 4.2.0-27-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v5.4.0
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] prepublish: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepublish script 'npm run build'.
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 babel-relay-plugin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs babel-relay-plugin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls babel-relay-plugin
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /home/mod/code/test/react-native/relay/examples/todo/npm-debug.log
> $
Strange! I just pulled a fresh copy of Relay from GitHub, performed the following steps, and got the following output. Can you do the same and paste your output?
git clone [email protected]:facebook/relay.git
cd relay/examples/todo
npm install
npm start
the same
~/code/test/relay/relay/examples/todo [16:53:06]
> $ npm install [卤master]
> [email protected] prepublish /home/mod/code/test/relay/relay/scripts/babel-relay-plugin
> npm run build
> [email protected] build /home/mod/code/test/relay/relay/scripts/babel-relay-plugin
> node scripts/build-lib
module.js:328
throw err;
^
Error: Cannot find module 'glob'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/mod/code/test/relay/relay/scripts/babel-relay-plugin/scripts/build-lib:6:14)
at Module._compile (module.js:398:26)
at Object.Module._extensions..js (module.js:405:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:430:10)
npm ERR! Linux 4.2.0-27-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v5.4.0
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `node scripts/build-lib`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'node scripts/build-lib'.
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 babel-relay-plugin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build-lib
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs babel-relay-plugin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls babel-relay-plugin
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /home/mod/code/test/relay/relay/scripts/babel-relay-plugin/npm-debug.log
npm ERR! addLocal Could not install /home/mod/code/test/relay/relay/scripts/babel-relay-plugin
> [email protected] prepublish /home/mod/code/test/relay/relay
> node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && npm run build
module.js:328
throw err;
^
Error: Cannot find module '/home/mod/code/test/relay/relay/node_modules/fbjs-scripts/node/check-dev-engines.js'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Function.Module.runMain (module.js:430:10)
at startup (node.js:141:18)
at node.js:1003:3
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! addLocal Could not install /home/mod/code/test/relay/relay
npm ERR! Linux 4.2.0-27-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v5.4.0
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] prepublish: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepublish script 'npm run build'.
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 babel-relay-plugin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs babel-relay-plugin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls babel-relay-plugin
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /home/mod/code/test/relay/relay/examples/todo/npm-debug.log
~/code/test/relay/relay/examples/todo [16:53:15]
> $ [卤master]
I had analogously problem a week ago.
Solved by editing relay/examples/todo/package.json - need replace relative packages on it npm version:
"babel-relay-plugin": "0.7.3",
"react-relay": "0.7.3",
I think the problem is that the local reference ("babel-relay-plugin": "file:../../scripts/babel-relay-plugin/") to the babel-relay-plugin is triggering the babel-relay-plugin/package.json scripts before the example's scripts.preinstall. Maybe due to the npm version? Am using 3.7.3.
Replacing the relative packages works, and another option is to run the preinstall script first
git clone [email protected]:facebook/relay.git
cd relay/examples/todo
npm run preinstall
npm install
npm start
Duplicate of https://github.com/facebook/relay/issues/906
I cleaned up the examples for the release of 0.9.0. Give them a try!
I tried (on OS X):
# Delete every globally installed npm module
npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm
# Return to pristine, first-cloned state
git clean -dfx
# Install and run the todo example
cd examples/todo
npm install
npm start
鈥nd had success. Here was the output. This was with npm v2.14.12 and Node v4.2.6.
If you experience trouble that I didn't, please do open an issue with your npm/Node versions and your output. Thanks for helping to keep the examples healthy everyone!
We're in the middle of a little bit of a revert/unrevert situation, so if anyone wants to try the examples in the next 24 hours or so be sure to check out the v0.9.0 tag:
git clone [email protected]:facebook/relay.git
cd relay
git checkout tags/v0.9.0
Most helpful comment
I had analogously problem a week ago.
Solved by editing
relay/examples/todo/package.json- need replace relative packages on it npm version: