admin管理员组文章数量:1325108
I'm using macOs and even though concurrently is installed globally through npm, when setting it as a start script in package.json and typing npm start
the following error occurs.
concurrently - kill-others "npm run server" "npm run client"
sh: concurrently - kill-others: mand not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] start: `concurrently - kill-others "npm run server" "npm run client"`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A plete log of this run can be found in:
npm ERR! /Users/mantzaris/.npm/_logs/2020-04-25T22_40_12_897Z-debug.log
My package.json file :
{
"name": "thesis_fullstack",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"client": "cd client && npm start",
"server": "cd server && npm start",
"start": "concurrently - kill-others \"npm run server\" \"npm run client\""
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"concurrently": "3.5.1"
}
}
I'm using macOs and even though concurrently is installed globally through npm, when setting it as a start script in package.json and typing npm start
the following error occurs.
concurrently - kill-others "npm run server" "npm run client"
sh: concurrently - kill-others: mand not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] start: `concurrently - kill-others "npm run server" "npm run client"`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A plete log of this run can be found in:
npm ERR! /Users/mantzaris/.npm/_logs/2020-04-25T22_40_12_897Z-debug.log
My package.json file :
{
"name": "thesis_fullstack",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"client": "cd client && npm start",
"server": "cd server && npm start",
"start": "concurrently - kill-others \"npm run server\" \"npm run client\""
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"concurrently": "3.5.1"
}
}
Share
edited Apr 26, 2020 at 13:58
MantzarisVas
asked Apr 25, 2020 at 22:59
MantzarisVasMantzarisVas
1233 silver badges9 bronze badges
4 Answers
Reset to default 3For
Globally -
npm install -g concurrently
Locally -
npm install concurrently
You need to install the dependency locally in order to use it in any of your start scripts. run
npm install --save concurrently
to install it locally in your project
Your error is not with the package itself, you can either have it globally or save it locally (not --save-dev).
You can find the solution for your problem looking at the error log
concurrently - kill-others "npm run server" "npm run client"
sh: concurrently - kill-others: mand not found
The mand should be either --kill-others or -k for short, here is the official documentation: https://github./kimmobrunfeldt/concurrently
Try this as your package.json
{
"name": "thesis_fullstack",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"client": "cd client && npm start",
"server": "cd server && npm start",
"start": "concurrently --kill-others \"npm run server\" \"npm run client\""
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"concurrently": "3.5.1"
}
}
Cheers :)
I seriously don't know what I did to fix it. First of all i fixed the mand flag "typo" to concurrently --kill-others your_mands_here. Then i uninstalled node manually and reinstalled it through Homebrew (since I'm using MacOs). After that node and npm wouldn't work at all. Fixed it with: https://stackoverflow./a/54583099/13212764. I think by that point running npm start worked.
本文标签: javascriptquotconcurrently command not foundquot but installed gloaballyStack Overflow
版权声明:本文标题:javascript - "concurrently command not found" but installed gloabally - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742141871a2422614.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论