NodeJS npm运行:未找到命令

qvk1mo1f  于 2023-02-15  发布在  Node.js
关注(0)|答案(1)|浏览(247)

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

npm run dev

> dev
> next

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

这是我目前的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"
  }
}

我完全不知道为什么会出现这个错误。
NodeJS和NPM已安装:

node -v
v16.14.2

npm -v
8.13.1
nukf8bse

nukf8bse1#

我在从一个运行脚本调用另一个运行脚本时遇到过这个问题。使用npm-run-all和run-s来启动命令修复了我在某些情况下的问题。我怀疑npm基于“平台”对shell和路径分隔符做了一些假设,或者没有正确地内省正在运行的shell。

相关问题