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.

allow shell commands for javascript projects (yarn/npm)

See original GitHub issue

the executable type doesn’t allow to run npm/yarn commands as it expects native binaries. this is fine as long as there is a binary build artifact. in case of javascript applications there is no binary artifact. e.g. running yarn or npm requires a node or a shell binary with the executable type. so the obvious way would be to just specify this binary e.g. executable: node yarn start. unfortunately this doesn’t work as tye expects the node binary to be in the working directory.

how about extending executable to allow an executable from the path search order? or a new type which would allow to execute a shell command?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:8
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
dalibormesariccommented, Feb 15, 2021

This actually works if you do the following

- name: front-end
  executable: cmd
  args: '/c npm run dev'

but it will work only on Windows

0reactions
onionhammercommented, Aug 22, 2022

This seems like somewhat low hanging fruit, since this works pretty much flawlessly except that ‘executable’ is difficult to make work cross-platform; “npm” will be in different places for different OSs/versions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to source shell script with npm scripts?
You can source your environment and run command in the same start syntax, "start": "source run-nvm.sh; cmd to run ; second cmd ;...
Read more >
4 Solutions To Run Multiple Node.js or NPM Commands ...
Today, I will share four ways to run multiple Node.js commands or NPM ... project (the "react-scripts start" command executes in the shell...
Read more >
How to execute shell commands in js
Although it is possible to execute shell commands in JavaScript, there are two important remarks: first that executing shell commands uses the ...
Read more >
Installation
It is recommended to install Yarn through the npm package manager, which comes bundled with Node.js when you install it on your system....
Read more >
How to Execute Shell Commands With Node.Js
This tutorial will teach you how to execute shell commands, and even your own custom shell scripts with Node.js.
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