I have a node/express/react application I am building using create-react-app for the client side. Whenever I run npm run build I get this error:
> [email protected] build /Users/crescentfresh/myApp/client
> react-scripts build
module.js:487
throw err;
^
Error: Cannot find module 'dotenv-expand'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at dotenvFiles.forEach.dotenvFile (/Users/crescentfresh/myApp/client/node_modules/react-scripts/config/env.js:43:5)
at Array.forEach (native)
at Object.<anonymous> (/Users/crescentfresh/myApp/client/node_modules/react-scripts/config/env.js:41:13)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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! /Users/crescentfresh/.npm/_logs/2018-10-09T23_53_36_314Z-debug.log
This is my package.json for my create-react-app directory:
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"proxy": {
"/api/*": {
"target": "http://localhost:3000"
}
},
"dependencies": {
"@uppy/core": "^0.27.3",
"@uppy/dashboard": "^0.27.5",
"@uppy/react": "^0.27.5",
"@uppy/tus": "^0.27.5",
"apollo-cache-inmemory": "^1.2.5",
"apollo-client": "^2.3.5",
"apollo-link": "^1.2.2",
"apollo-link-error": "^1.1.0",
"apollo-link-http": "^1.5.4",
"apollo-link-state": "^0.4.1",
"axios": "^0.18.0",
"bootstrap": "^4.1.1",
"graphql": "^0.13.2",
"graphql-tag": "^2.9.2",
"prop-types": "^15.6.2",
"react": "^16.4.1",
"react-apollo": "^2.1.9",
"react-dom": "^16.4.1",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-scripts": "2.0.3",
"react-spinners": "^0.4.5",
"reactstrap": "^6.2.0",
"recompose": "^0.29.0"
},
"scripts": {
"start": "cross-env PORT=3003 react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"cross-env": "^5.2.0"
}
}
This used to build but recently began failing. I tried removing the packages that were added sometime before the failed builds happened but that didn't help (uppy and axios packages) so I am not sure if that's even related.
If there's anything else I should include please let me know.