【发布时间】:2021-03-16 23:37:18
【问题描述】:
我有一个单独的 Chrome 配置文件来进行开发工作。
当我运行 npm start 时,它会打开我的默认 Chrome 配置文件。
我希望它打开我的开发资料。
我尝试在项目的根目录中创建一个.env 文件,其中包含以下内容
REACT_APP_BROWSER=chrome
REACT_APP_BROWSER_ARGS=--profile-directory="Profile 1"
安装env-cmd 并在package.json 文件的脚本部分更改启动命令
"start": "env-cmd .env npm react-scripts start",
但是当我运行npm start 时,我收到以下错误:
alex@Alex-PC:~/code/udemy/grider/pics$ npm start
> pics@0.1.0 start /home/alex/code/udemy/grider/pics
> env-cmd .env npm react-scripts start
spawn .env ENOENT
npm ERR! code ELIFECYCLE
npm ERR! errno 130
npm ERR! pics@0.1.0 start: `env-cmd .env npm react-scripts start`
npm ERR! Exit status 130
npm ERR!
npm ERR! Failed at the pics@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/alex/.npm/_logs/2020-12-04T22_27_25_381Z-debug.log
我是走在正确的轨道上还是完全走错了方向?
【问题讨论】:
-
下面的答案有帮助吗?
标签: node.js reactjs npm npm-start