question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot run program "npx": error=2, No such file or directory

See original GitHub issue

Environment

    OS: macOS 12.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 169.41 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.4.0 - /opt/homebrew/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 6.9.0 - ~/workspace/wtapp-react/node_modules/.bin/npm
    Watchman: 2022.01.17.00 - /opt/homebrew/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7935034
    Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.5 => 0.61.5

Description

:ReactNative:Running 'npx --quiet --no-install react-native config' command from 'null' directory failed.

FAILURE: Build failed with an exception.

* Where:
Script '/Users/chenlong/workspace/wtapp-react/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 154

* What went wrong:
A problem occurred evaluating script.
> Cannot run program "npx": error=2, No such file or directory

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 332ms

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
vovkasmcommented, Jan 31, 2022

It seems like Android Studio Bumblebee no more reads shell environment from .zshenv/.bashrc/etc… files as a result it run gradle with system PATHs. Here bug report and some solutions: https://issuetracker.google.com/issues/216364005?pli=1

And for lazy: chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv, then restart Android Studio

0reactions
github-actions[bot]commented, Nov 26, 2022

There hasn’t been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot run program "npx": error=2, No such file or directory ...
I'm using Android Studio 4 on Mac OS Catalina 10.15.6. I solved the problem by running Android Studio with bellow command on console....
Read more >
Cannot run program "npx": error=2, No such file or directory
Steps taken to start new fresh project. installed nvm; installed node using nvm; initiated a new project : npx react-native init projectname ...
Read more >
cause error=2, no such file or directory react-native
cannot run program "npx": error=2, no such file or directory ... Go to Run/Debug configuration and set Shorten command line to "JAR manifest"....
Read more >
React Native on Android: Cannot run program "node": error=2 ...
Android : React Native on Android: Cannot run program "node": error=2, No such file or directory [ Beautify Your Computer ...
Read more >
npx react-native run-android build failed - You.com
IOException: Cannot run program "security" (in directory "C:\Users\Student\Desktop\mobile-wallet\android\app"): CreateProcess error=2, The system cannot ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found