Система:
ОС: Windows 10 IDE: код Visual Studio
Я работаю над приложением реагирования, которое содержит пакет ниже. json
{
"name": "test-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"animakit-expander": "^2.1.4",
"animakit-rotator": "^2.1.3",
"axios": "^0.19.0",
"circular-json": "^0.5.9",
"env-cmd": "^10.0.1",
"file-saver": "^2.0.2",
"jquery": "^3.4.1",
"jsonwebtoken": "^8.5.1",
"jszip": "^3.2.2",
"mdbreact": "^4.22.1",
"rc-queue-anim": "^1.8.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-if-elseif-else-render": "^1.0.2",
"react-lazylog": "^4.4.1",
"react-loading-overlay": "^1.0.1",
"react-native-orientation-loading-overlay": "^0.1.6",
"react-overlay-loader": "0.0.3",
"react-overlay-loading": "^1.0.3",
"react-scripts": "3.2.0",
"react-scrollbar": "^0.5.6",
"react-transition-group": "^4.3.0",
"reactjs-popup": "^1.5.0",
"reactstrap": "^8.1.1",
"velocity-react": "^1.4.3"
},
"scripts": {
"start": "env-cmd -f ./.env.dev react-scripts start",
"start-dev": "env-cmd -f ./.env.dev react-scripts start",
"test": "react-scripts test --coverage",
"eject": "react-scripts eject",
"build": "react-scripts build",
"start1": "react-scripts start"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Когда я запускаю команду в терминале, npm Запуск запуска , я сталкиваюсь с проблемой ниже:
> test-app@0.1.0 start C:\dev\test-app
> env-cmd -f ./.env.dev react-scripts start
'-f' is not recognized as an internal or external command,
operable program or batch file.
spawn -f ENOENT
internal/process/per_thread.js:189
throw errnoException(err, 'kill');
^
Error: kill ENOSYS
at process.kill (internal/process/per_thread.js:189:13)
at TermSignals._terminateProcess (C:\dev\test-app\node_modules\env-cmd\dist\signal-termination.js:47:28)
at process.terminateSpawnedProcessFuncHandlers.<computed> (C:\dev\test-app\node_modules\env-cmd\dist\signal-termination.js:20:30)
at Object.onceWrapper (events.js:300:26)
at process.emit (events.js:210:5)
at process.exit (internal/process/per_thread.js:158:15)
at TermSignals._uncaughtExceptionHandler (C:\dev\test-app\node_modules\env-cmd\dist\signal-termination.js:68:17)
at process.<anonymous> (C:\dev\test-app\node_modules\env-cmd\dist\signal-termination.js:40:53)
at process.emit (events.js:210:5)
at process._fatalException (internal/process/execution.js:150:25) {
errno: 'ENOSYS',
code: 'ENOSYS',
syscall: 'kill'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! test-app@0.1.0 start: `env-cmd -f ./.env.dev react-scripts start`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the test-app@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! C:\Users\me\AppData\Roaming\npm-cache\_logs\2020-01-09T07_15_50_457Z-debug.log
и где как, когда я запускаю env-cmd -f ./.env.dev реактивные скрипты запускаются непосредственно в любом терминале, мое приложение работает нормально.
Пожалуйста, предоставьте ваши предложения.