Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack Error: gyp failed with exit code: 1 in node v6.2.1 #979

Closed
trojanliu opened this issue Jul 5, 2016 · 5 comments
Closed

stack Error: gyp failed with exit code: 1 in node v6.2.1 #979

trojanliu opened this issue Jul 5, 2016 · 5 comments

Comments

@trojanliu
Copy link

trojanliu commented Jul 5, 2016

ccap@0.6.9 install /testProject/node_modules/ccap

node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
Traceback (most recent call last):
File "/root/git/nvm/versions/node/v6.2.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in
sys.exit(gyp.script_main())
File "/root/git/nvm/versions/node/v6.2.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 545, in script_main
return main(sys.argv[1:])
File "/root/git/nvm/versions/node/v6.2.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 538, in main
return gyp_main(args)
File "/root/git/nvm/versions/node/v6.2.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 514, in gyp_main
options.duplicate_basename_check)
File "/root/git/nvm/versions/node/v6.2.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 130, in Load
params['parallel'], params['root_targets'])
File "/root/git/nvm/versions/node/v6.2.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2775, in Load
variables, includes, depth, check, True)
File "/root/git/nvm/versions/node/v6.2.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile
includes, True, check)
File "/root/git/nvm/versions/node/v6.2.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 243, in LoadOneBuildFile
None)
File "binding.gyp", line 1
{
^
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/root/git/nvm/versions/node/v6.2.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 2.6.32-642.1.1.el6.x86_64
gyp ERR! command "/root/git/nvm/versions/node/v6.2.1/bin/node" "/root/git/nvm/versions/node/v6.2.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /testProject/node_modules/ccap
gyp ERR! node -v v6.2.1
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok

@bnoordhuis
Copy link
Member

Wrong repo; node-gyp is telling you in a roundabout way that ccap's binding.gyp is invalid. Please report it to that project.

@guymguym
Copy link
Contributor

Hi @bnoordhuis

This issues seems to be popping up whenever the binding.gyp file has dos line breaks \r\n and the python version fails in eval() with a string containing \r\n.

See my comment here - nospaceships/node-net-ping#24 (comment)

It's not yet clear why in some cases running python -c 'eval("{\r\n}")' will fail even for new python 2.7.10 version but there are complaints that this is indeed happening.

Would you consider accepting a PR to fix the code in:
https://github.com/nodejs/node-gyp/blob/master/gyp/pylib/gyp/input.py#L233
To this:

    build_file_contents = open(build_file_path).read().replace('\r\n', '\n')

Thanks!

@bnoordhuis
Copy link
Member

Since it's only a small change, I think that would be acceptable as long as it has an explaining comment.

guymguym added a commit to guymguym/node-gyp that referenced this issue Nov 13, 2016
To make sure platform specific newlines ('\r\n' or '\r') are converted to '\n' which otherwise will fail eval().

This should handle multiple issues reported on syntax error reading binding.gyp (partial list):
nodejs#979
nodejs#199
nospaceships/node-net-ping#24
nospaceships/node-net-ping#21
mathiask88/node-snap7#11
node-hid/node-hid#28
xdenser/node-firebird-libfbclient#24
bnoordhuis pushed a commit that referenced this issue Nov 16, 2016
To make sure platform specific newlines ('\r\n' or '\r') are converted
to '\n' which otherwise will fail eval().

This should handle multiple issues reported on syntax error reading
binding.gyp (partial list):

#979
#199
nospaceships/node-net-ping#24
nospaceships/node-net-ping#21
mathiask88/node-snap7#11
node-hid/node-hid#28
xdenser/node-firebird-libfbclient#24

PR-URL: #1053
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
refack pushed a commit to refack/node-gyp that referenced this issue Apr 23, 2017
To make sure platform specific newlines ('\r\n' or '\r') are converted
to '\n' which otherwise will fail eval().

This should handle multiple issues reported on syntax error reading
binding.gyp (partial list):

nodejs#979
nodejs#199
nospaceships/node-net-ping#24
nospaceships/node-net-ping#21
mathiask88/node-snap7#11
node-hid/node-hid#28
xdenser/node-firebird-libfbclient#24

PR-URL: nodejs#1053
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
refack pushed a commit to refack/node-gyp that referenced this issue Aug 19, 2017
To make sure platform specific newlines ('\r\n' or '\r') are converted
to '\n' which otherwise will fail eval().

This should handle multiple issues reported on syntax error reading
binding.gyp (partial list):

nodejs#979
nodejs#199
nospaceships/node-net-ping#24
nospaceships/node-net-ping#21
mathiask88/node-snap7#11
node-hid/node-hid#28
xdenser/node-firebird-libfbclient#24

PR-URL: nodejs#1053
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@sonydaman
Copy link

gyp: binding.gyp not found (cwd: F:\xampp_New\htdocs\REPO\REACTNATIVE\react-native-facebook-account-kit\examples\RN024) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\SonyDaman\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\SonyDaman\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "configure"
gyp ERR! cwd F:\xampp_New\htdocs\REPO\REACTNATIVE\react-native-facebook-account-kit\examples\RN024
gyp ERR! node -v v6.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

@sonydaman
Copy link

node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@6.11.2 | win32 | x64
gyp info spawn C:\Python27\python.EXE
gyp info spawn args [ 'C:\Users\SonyDaman\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=auto',
gyp info spawn args '-I',
gyp info spawn args 'F:\xampp_New\htdocs\REPO\REACTNATIVE\react-native-facebook-account-kit\examples\RN024\build\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\SonyDaman\AppData\Roaming\npm\node_modules\node-gyp\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\SonyDaman\.node-gyp\6.11.2\include\node\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\Users\SonyDaman\.node-gyp\6.11.2',
gyp info spawn args '-Dnode_gyp_dir=C:\Users\SonyDaman\AppData\Roaming\npm\node_modules\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\Users\SonyDaman\.node-gyp\6.11.2\<(target_arch)\node.lib',
gyp info spawn args '-Dmodule_root_dir=F:\xampp_New\htdocs\REPO\REACTNATIVE\react-native-facebook-account-kit\examples\RN024',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'F:\xampp_New\htdocs\REPO\REACTNATIVE\react-native-facebook-account-kit\examples\RN024\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: F:\xampp_New\htdocs\REPO\REACTNATIVE\react-native-facebook-account-kit\examples\RN024) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\SonyDaman\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\SonyDaman\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "configure"
gyp ERR! cwd F:\xampp_New\htdocs\REPO\REACTNATIVE\react-native-facebook-account-kit\examples\RN024
gyp ERR! node -v v6.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants