cloudfoundry-community / node-cfenv

easy access to your Cloud Foundry application environment for node
Apache License 2.0
73 stars 20 forks source link

error when importing cfenv #34

Closed naveenrc closed 6 years ago

naveenrc commented 6 years ago
ERROR in ./~/cfenv/lib/cfenv.js
Module not found: Error: Can't resolve 'fs' in '/Users/ei5875/Downloads/pbm-machine-learning-portal/node_modules/cfenv/lib'
 @ ./~/cfenv/lib/cfenv.js 5:7-20
 @ ./src/components/home/HomePage.js
 @ ./src/routes.js
 @ ./src/components/Root.js
 @ ./src/index.js
 @ multi ./src/webpack-public-path react-hot-loader/patch webpack-hot-middleware/client?reload=true whatwg-fetch ./src/index.js

ERROR in ./~/ports/index.js
Module not found: Error: Can't resolve 'fs' in '/Users/ei5875/Downloads/pbm-machine-learning-portal/node_modules/ports'
 @ ./~/ports/index.js 10:9-22
 @ ./~/cfenv/lib/cfenv.js
 @ ./src/components/home/HomePage.js
 @ ./src/routes.js
 @ ./src/components/Root.js
 @ ./src/index.js
 @ multi ./src/webpack-public-path react-hot-loader/patch webpack-hot-middleware/client?reload=true whatwg-fetch ./src/index.js
pmuellr commented 6 years ago

Your primary problem is that you are attempting to use cfenv within an app meant to be run on a web browser, I guess, since you're using webpack.

cfenv is designed to be run on a server, it's not going to do anything interesting in a browser.

Closing, but feel free to open if I'm missing some other context.