NPM运行:找不到命令

发布于 2025-02-12 03:45:17 字数 1384 浏览 1 评论 0原文

当我尝试运行npm运行devnpm run build我得到以下错误:

npm run dev

> dev
> next

/usr/bin/bash: D:Tempdev-1656515078305.sh: command not found

这是我的当前package.json.json

{
  "private": true,
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start",
    "type-check": "tsc"
  },
  "dependencies": {
    "bootstrap": "^5.1.3",
    "marked": "^4.0.17",
    "next": "latest",
    "nodemailer": "^6.7.5",
    "react": "^18.1.0",
    "react-bootstrap": "^2.4.0",
    "react-dom": "^18.1.0",
    "react-icons": "^4.4.0"
  },
  "devDependencies": {
    "@fullhuman/postcss-purgecss": "^4.1.3",
    "@types/node": "^17.0.35",
    "@types/react": "^18.0.9",
    "@types/react-dom": "^18.0.4",
    "@typescript-eslint/eslint-plugin": "^5.30.0",
    "@typescript-eslint/parser": "^5.30.0",
    "eslint": "^8.18.0",
    "eslint-config-standard": "^17.0.0",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-n": "^15.2.3",
    "eslint-plugin-promise": "^6.0.0",
    "eslint-plugin-react": "^7.30.1",
    "eslint-plugin-react-hooks": "^4.6.0",
    "postcss-preset-env": "^7.6.0",
    "sass": "^1.53.0",
    "tailwindcss": "^3.0.24",
    "typescript": "4.6"
  }
}

我绝对有不知道为什么会发生此错误。

安装了nodejs和npm:

node -v
v16.14.2

npm -v
8.13.1

When I try to run npm run dev or npm run build I get the following error:

npm run dev

> dev
> next

/usr/bin/bash: D:Tempdev-1656515078305.sh: command not found

This is my current package.json:

{
  "private": true,
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start",
    "type-check": "tsc"
  },
  "dependencies": {
    "bootstrap": "^5.1.3",
    "marked": "^4.0.17",
    "next": "latest",
    "nodemailer": "^6.7.5",
    "react": "^18.1.0",
    "react-bootstrap": "^2.4.0",
    "react-dom": "^18.1.0",
    "react-icons": "^4.4.0"
  },
  "devDependencies": {
    "@fullhuman/postcss-purgecss": "^4.1.3",
    "@types/node": "^17.0.35",
    "@types/react": "^18.0.9",
    "@types/react-dom": "^18.0.4",
    "@typescript-eslint/eslint-plugin": "^5.30.0",
    "@typescript-eslint/parser": "^5.30.0",
    "eslint": "^8.18.0",
    "eslint-config-standard": "^17.0.0",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-n": "^15.2.3",
    "eslint-plugin-promise": "^6.0.0",
    "eslint-plugin-react": "^7.30.1",
    "eslint-plugin-react-hooks": "^4.6.0",
    "postcss-preset-env": "^7.6.0",
    "sass": "^1.53.0",
    "tailwindcss": "^3.0.24",
    "typescript": "4.6"
  }
}

I have absolutely no idea why this error occurs.

NodeJS and NPM are installed:

node -v
v16.14.2

npm -v
8.13.1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落叶缤纷 2025-02-19 03:45:17

当从另一个人调用一个run-script时,我遇到了这个问题。使用npm-run-all和 run-s 在某些情况下启动命令解决了我的问题。我怀疑NPM基于“平台”或不正确地内省运行的外壳对外壳和路径分离器做出了一些假设。

I've encountered this issue when calling one run-script from another. Using npm-run-all and run-s to launch commands fixed my issues in some scenarios. I suspect that npm is making some assumptions about the shell and path separator based on the 'platform' or not properly introspecting the running shell.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文