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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fiddle can't find NodeJS and npm #68

Closed
tosho opened this issue Aug 12, 2018 · 6 comments 路 Fixed by #72
Closed

Fiddle can't find NodeJS and npm #68

tosho opened this issue Aug 12, 2018 · 6 comments 路 Fixed by #72
Assignees
Labels
馃 bug Something isn't working

Comments

@tosho
Copy link

tosho commented Aug 12, 2018

I run to this when I try to create a package/installer

Tasks > Package Fiddle...

馃摝 Packaging current Fiddle...
7:32:31 PMError: Could not find npm. Fiddle requires Node.js and npm to compile packages. Please visit https://nodejs.org to install Node.js and npm.

Tasks > Make Installers for Fiddle...

7:32:37 PM馃摝 Creating installers for current Fiddle...
7:32:37 PMError: Could not find npm. Fiddle requires Node.js and npm to compile packages. Please visit https://nodejs.org to install Node.js and npm.

running Ubuntu 18.04.1 , NodeJS v10.8.0 via nvm 0.33.11, npm 6.3.0

@felixrieseberg
Copy link
Member

Thank you for reporting, this is interesting! I'm wondering how we could convince your machine to find npm.

Could you do me a favor and try the following?

  1. Open fiddle
  2. Open the developer tools (Help - Show developer tools)
  3. In the console, enter the following: require('child_process').execSync('which npm').toString(). Let me know what the output is! It likely won't find npm, but we should cover that first.
  4. Then, let's see what we can and cannot find: require('child_process').execSync('echo $PATH').toString()
  5. Lastly, in a terminal, enter which npm and let me know where it lives.

Thanks!

@tosho
Copy link
Author

tosho commented Aug 13, 2018

require('child_process').execSync('which npm').toString()
child_process.js:656 Uncaught Error: Command failed: which npm
    at checkExecSyncError (child_process.js:613)
    at Object.execSync (child_process.js:653)
    at Object.execSync (ELECTRON_ASAR.js:728)
    at <anonymous>:1:26

require('child_process').execSync('echo $PATH').toString()
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
"
$ which npm
/home/tosho/.nvm/versions/node/v10.8.0/bin/npm

@felixrieseberg
Copy link
Member

Thanks a ton! I think we can fix this.

@tommedema
Copy link

I'm still getting this on MacOS 10.15.6

which npm gives me /Users/tommedema/.nvm/versions/node/v12.14.1/bin/npm

@daslicht
Copy link

how do you fixed it please?

@ccniit
Copy link

ccniit commented Jun 15, 2023

My fixed steps

  1. Open fiddle
  2. Open the developer tools (Help - Toggle developer tools)
  3. Excute following code in developer-tools console to find the current shell,
    require('child_process').execSync('echo $SHELL').toString()
  4. Get npm path at you System terminal
    which npm
  5. Config npm path enviroment for the shell at step 3; eg: zsh shell is .zshrc;
  6. Restart the fiddle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants