javascript - "concurrently: command not found"尽管已安装

标签 javascript npm create-react-app

关闭。这个问题需要debugging details .它目前不接受答案。












编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将帮助其他人回答问题。


2年前关闭。







Improve this question




我试图同时运行两个脚本,我发现了这个包concurrently据说这会对我有所帮助。我做了npm install concurrently --save它列在我的package.json .但是,当我去运行它时,它会抛出:
concurrently: command not found
我不明白为什么即使安装它也找不到它。我已经设置了如下所示的命令 here ,所以我知道不可能这样。我已经检查过这个问题的早期实例,但它似乎已经过时了。有没有其他方法可以检查这是否有效,或者我应该尝试其他方法吗?

截屏:

enter image description here

最佳答案

当您使用 npm install 安装时未指定 global旗帜 -g ,您正在将模块安装到您的项目中 node_modules文件夹。如果该模块有任何可运行的二进制文件,它们将被添加到 node_modules/.bin - 所以你应该能够运行本地版本的concurrently通过运行 node_modules/.bin/concurrently (或从您项目中的任何文件夹 $(npm bin)/concurrently )。我个人更喜欢使用项目的本地依赖项而不是安装全局依赖项,因此我可以选择在另一个项目中使用不同的版本。

如果您将脚本放入 package.json "scripts" field它将引用这些本地安装而无需指定完整路径,因为 npm run添加您的项目node_modules/.bin到你的路。

如果您遇到问题,我会先检查 node_modules/.bin文件夹并验证脚本的二进制文件是否确实存在。

关于javascript - "concurrently: command not found"尽管已安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55066738/

相关文章:

javascript - Webpack 无法识别节点模块中的 jsx 代码

javascript - 在 Meteor 1.3 中使用 Request npm 模块同步

npm - 抑制所有 npm run 输出但显示脚本输出

node.js - 在离线计算机上创建 NPM 注册表的副本?

javascript - 如何在 React 的构建阶段禁用 ESLint

reactjs - 使用 create-react-app 构建转译第三方模块

javascript - 单击时使用 Jquery 刷新 div

javascript - 将 Spring 模型属性传递给 JS 脚本

javascript - toLocaleString 在 Android 7.1 上的 Chrome 88 上损坏

Node.js:如何设置 npm start?