NPM运行:找不到命令
当我尝试运行npm运行dev
或npm 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当从另一个人调用一个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.