-1

I am trying to run a npx command on my M1 MacBook but I keep getting the same error. I already installed node.js and npm so that I could run this command:

npx @mondaydotcomorg/monday-cli scaffold run ./ quickstart-react

However, when I run this command the output is:

> Repository was downloaded successfully
> Copying the directory
> Installing packages. It can take a few moments
> Node modules were installed successfully
> Running the project
Error: Command failed: npm run start

    at ChildProcess.exithandler (node:child_process:389:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Socket.<anonymous> (node:internal/child_process:449:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:757:14) {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'npm run start'
}

Before, I was getting an issue saying sh: concurrently: command not found and kill-port: command not found so I installed concurrently and kill-port using npm, which removed this error messages. However, now I get the output above. I installed node.js again and updated npm version to latest version, but no change. Any suggestions on how to fix this?

Edit: I found this link that is a solution to my exact problem. (https://community.monday.com/t/monday-cli-seems-not-to-work-on-apple-m1/36745). I ran npm install kill-port and ran npm upgrade and both executed correctly. However, when I try to run npm run start command by itself, this is my output:

npm ERR! Missing script: "start"
npm ERR! 
npm ERR! Did you mean one of these?
npm ERR!     npm star # Mark your favorite packages
npm ERR!     npm stars # View packages marked as favorites
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mattspc/.npm/_logs/2022-07-18T21_08_52_459Z-debug-0.log

I think I need to find my destination folder and cd to it, then run npm run start within that folder. Any advice on how to locate it?

mpp
  • 308
  • 1
  • 14
  • Given that the repo/homepage linked on https://www.npmjs.com/package/@mondaydotcomorg/monday-cli doesn't exist, and that the `monday-cli` project does not exist [on Monday's group account](https://github.com/orgs/mondaycom/repositories), you almost certainly don't want to use this to begin with. – Mike 'Pomax' Kamermans Jul 14 '22 at 23:51
  • @Mike'Pomax'Kamermans there is a "Help" link on the screen that I got the command from. Here is the link https://apps.developer.monday.com/docs/quickstart-view The very first video/gif on the linked site shows the same command and this same command worked for multiple other people this morning (however, they are using Windows PC while I am on a Mac). What do you suggest I do in this situation? – mpp Jul 15 '22 at 03:00
  • @Mike'Pomax'Kamermans I understand your comment now, that is odd that the repo doesn't exist. To clarify my first comment, the video shows the same command so I thought maybe I had a typo in the command I was using but since the video on that site shows the same command I've ruled out that possibility. Do you think there could also be a potential issue with my npm or node.js install? – mpp Jul 15 '22 at 03:26
  • I strongly suggest contacting Monday and explaining that their own docs/videos point to a library that doesn't have a repo/homepage anymore, so that they can help fix this (not just for you, but for everyone) Because at this point you can't even be sure you're using the same tool that the video shows, because you have no way of verifying that the thing you have is _actually_ the thing they show. – Mike 'Pomax' Kamermans Jul 15 '22 at 04:27
  • @Mike'Pomax'Kamermans update: Contacted Monday and also found this article [link](https://community.monday.com/t/monday-cli-seems-not-to-work-on-apple-m1/36745) that has the same issue. However, I still get another issue (had to explain in post because not enough characters to put it in comments). – mpp Jul 18 '22 at 21:29
  • The error is telling you that your `package.json` file does not have a "start" script, so: normally, simply be in the dir with your `package.json` and then run `npm start` from there, otherwise NPM starts looking one dir up for `package.json`, and if there isn't one, it goes up another dir, and if there isn't one, it goes up another dir, etc. etc. until it runs out of dirs to go up to. – Mike 'Pomax' Kamermans Jul 18 '22 at 22:08
  • @Mike'Pomax'Kamermans I appreciate your help and the advice comments. I went down a rabbit hole of installations and articles, threads, stack questions, etc. but was finally able to find a solution. Saw comments on older threads from you and followed advice from those to lead me in the right direction. Thanks. – mpp Jul 20 '22 at 06:37

1 Answers1

0

Finally figured out an answer to my own question. The main issue was my npm version and node.js version.

To get the latest stable version of npm, run this command in terminal npm install -g npm@latest and make sure you download the correct node.js version (this one is for Apple Silicon Chip/M1, select the option on the left). Then, run nvm use --lts command in terminal to make sure you are using the correct and most stable node.js version. Finally, look in the main directory (firstnamelastname folder on Mac) and delete the quickstart-react folder if it already exists. Then, run npx @mondaydotcomorg/monday-cli scaffold run ./ quickstart-react in terminal (if there is an error message, quit terminal and reopen it, then continue with the next step). You need to run the next part locally, so do cd quickstart-react, then npm run start and it should work. If there is any error message and it says something like sh: kill-port: command not found you need to install that specific dependency within the quickstart-react folder, so search up "npm install kill-port" or "npm install ____" depending on the error, quit and reopen terminal, do cd quickstart-react and run those install commands inside the quickstart-react folder. Should work after that.

If this doesn't work try using this link (https://community.monday.com/t/problem-to-setup-development-environment-quick-start-guide-with-cli/9422) that shows how to manually do this (this didn't work for me however).

mpp
  • 308
  • 1
  • 14
  • Note that if you tell nvm to install the latest node, you're also going to get the latest (stable) npm for that version of node. You should never need to update "just npm". – Mike 'Pomax' Kamermans Jul 20 '22 at 15:00