'PORT' 未被识别为内部或外部命令
'PORT' is not recognized as an internal or external command
当我运行yarn dev
它在命令提示符下显示以下错误:
yarn run v1.22.11
$ PORT=3005 next dev
'PORT' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我的 package.json
是这样的:
"scripts": {
"dev": "PORT=3005 next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "jest"
},
如何解决这个错误?
注:我用的是WindowsOS.
我在 Windows OS:
并使用 "dev": "next dev -p 3005"
解决了这个问题
改变你的package.json
:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "jest"
},
然后在你的项目目录下创建一个.env
文件,并设置为:
'.env'文件
PORT=3005
然后 运行 你的项目:)
当我运行yarn dev
它在命令提示符下显示以下错误:
yarn run v1.22.11
$ PORT=3005 next dev
'PORT' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我的 package.json
是这样的:
"scripts": {
"dev": "PORT=3005 next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "jest"
},
如何解决这个错误?
注:我用的是WindowsOS.
我在 Windows OS:
并使用 "dev": "next dev -p 3005"
改变你的package.json
:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "jest"
},
然后在你的项目目录下创建一个.env
文件,并设置为:
'.env'文件
PORT=3005
然后 运行 你的项目:)