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

NPM install fails with node-gyp error: cannot use a string pattern on a bytes-like object #155

Open
cakoose opened this issue Feb 26, 2020 · 0 comments · May be fixed by #156
Open

NPM install fails with node-gyp error: cannot use a string pattern on a bytes-like object #155

cakoose opened this issue Feb 26, 2020 · 0 comments · May be fixed by #156

Comments

@cakoose
Copy link
Contributor

cakoose commented Feb 26, 2020

  • macOS 10.15.3, Node 12.14.1
  • I tested with a package.json that lists just a single dependency, "sodium" at version "3.0.2".
  • I tried with both yarn install and npm install
  • I tried both Python 2.7.17 and 3.7.6. (I used the environment variable NODE_GYP_FORCE_PYTHON, which I think worked because the output says "gyp info find Python using Python version ..." and the version matches what I set.)

Full yarn install output:

yarn install v1.21.1
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
error /Users/kannan/temp/node_modules/sodium: Command failed.
Exit code: 1
Command: node install.js --install
Arguments: 
Directory: /Users/kannan/temp/node_modules/sodium
Output:
echo Build node-sodium module
Build node-sodium module
node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info find Python using Python version 2.7.17 found at "/Users/kannan/.pyenv/versions/2.7.17/bin/python2.7"
gyp info spawn /Users/kannan/.pyenv/versions/2.7.17/bin/python2.7
gyp info spawn args [
gyp info spawn args   '/Users/kannan/.nodenv/versions/12.14.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/kannan/temp/node_modules/sodium/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/kannan/.nodenv/versions/12.14.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/kannan/Library/Caches/node-gyp/12.14.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/kannan/Library/Caches/node-gyp/12.14.1',
gyp info spawn args   '-Dnode_gyp_dir=/Users/kannan/.nodenv/versions/12.14.1/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/kannan/Library/Caches/node-gyp/12.14.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/kannan/temp/node_modules/sodium',
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   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o
  LIBTOOL-STATIC Release/nothing.a
Traceback (most recent call last):
  File "./gyp-mac-tool", line 611, in <module>
    sys.exit(main(sys.argv[1:]))
  File "./gyp-mac-tool", line 30, in main
    exit_code = executor.Dispatch(args)
  File "./gyp-mac-tool", line 45, in Dispatch
    return getattr(self, method)(*args[1:])
  File "./gyp-mac-tool", line 248, in ExecFilterLibtool
    if not libtool_re.match(line) and not libtool_re5.match(line):
TypeError: cannot use a string pattern on a bytes-like object
make[1]: *** [Release/nothing.a] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/kannan/.nodenv/versions/12.14.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:223:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/Users/kannan/.nodenv/versions/12.14.1/bin/node" "/Users/kannan/.nodenv/versions/12.14.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/kannan/temp/node_modules/sodium
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
make: *** [nodesodium] Error 1
/Users/kannan/temp/node_modules/sodium/install.js:293
            throw new Error(cmdLine + ' exited with code ' + code);
            ^

Error: make nodesodium exited with code 2
    at ChildProcess.<anonymous> (/Users/kannan/temp/node_modules/sodium/install.js:293:19)
    at ChildProcess.emit (events.js:223:5)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
cakoose added a commit to cakoose/node-sodium that referenced this issue Feb 26, 2020
@cakoose cakoose linked a pull request Feb 26, 2020 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant