javascript - 未找到命令但模块存在
问题描述
我有一个节点模块 rimraf。它肯定存在基于能够单击它
并登陆它在 node_modules 下的文件夹。但我收到错误说 command not found
for rimraf。
试图删除整个node_module。
还尝试了以下命令。
npm ci
和
npm cache clear --force
npm i
没有错误,一些关于许可的警告消息和
没有找到模块驱动模块的存储库字段。
现在,当我运行以下命令时,我最终会遇到错误。
npm run build
错误
sh: rimraf: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! dyna-modules@0.2.0 build: `rimraf build && bundle-trace-app --clientConfig webpack/client.config.js --serverConfig webpack/server.config.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the dyna-module@0.2.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
会是什么问题?考虑到rimraf 的存在?
解决方案
也许您可以尝试使用此命令
rm -rf node_modules package-lock.json或在重新安装节点模块之前手动删除它
推荐阅读
- eclipse - 如何将 eclipse formatter.xml 转换为 Checkstyle 规则
- python - 如何使用“包含”过滤器进行查询但不区分大小写?
- java - 安卓。JSON 解析器在我的新模块中返回 null
- python - 追加正在覆盖类列表中的现有数据
- c# - 创建自定义控件并将其添加到 Xamarin 中的 ListView。但它只在我双击时触发。我希望 ItemTapped 在单击时触发
- if-statement - 计算两个互斥的类别行中的项目数
- python - Django:具有过滤的多对多的多个分组注释
- python - Python Dictionary 如何创建列表项的组合?
- android - 用于多模块项目的 Firebase
- apache - Symfony 5 - 多个客户端域