Skip to content

Can't run yarn start on Mac OS X: Module not found: Error: Can't resolve fs #4347

@byforcesunseen

Description

@byforcesunseen

Description of Issue

Can't run latest MyCrypto source locally on Mac OS X due to missing fs dependency:

$ yarn start

yarn run v1.22.19
$  yarn run dev
...

ERROR  Failed to compile with 1 errors

This dependency was not found:

* fs in ./node_modules/dotenv/lib/main.js

To install it, you can run: npm install --save fs

What exactly were you doing when you encountered this issue?

  1. Clone repo

    $ git clone https://github.com/MyCryptoHQ/MyCrypto.git
    $ git rev-parse HEAD
    
    457ec2f0a1cce537275c3b67d7e871f1ae3ae162
  2. Run yarn, no errors occur:
    $ yarn
    
    yarn install v1.22.19
    [1/5] 🔍  Validating package.json...
    [2/5] 🔍  Resolving packages...
    warning Resolution field "@emotion/sheet@1.0.1" is incompatible with requested version "@emotion/sheet@0.9.4"
    warning Resolution field "@emotion/sheet@1.0.1" is incompatible with requested version "@emotion/sheet@0.9.4"
    [3/5] 🚚  Fetching packages...
    [4/5] 🔗  Linking dependencies...
    warning " > @mycrypto/ui@0.24.1" has incorrect peer dependency "react@^16.8.0".
    warning " > @mycrypto/ui@0.24.1" has incorrect peer dependency "react-dom@^16.8.0".
    warning "@mycrypto/ui > react-popper-tooltip@2.11.1" has incorrect peer dependency "react@^16.6.0".
    warning "@mycrypto/ui > react-popper-tooltip@2.11.1" has incorrect peer dependency "react-dom@^16.6.0".
    warning "@mycrypto/ui > react-popper-tooltip > react-popper > create-react-context@0.3.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
    warning " > apollo-boost@0.4.7" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0".
    warning " > recharts@1.8.5" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
    warning " > recharts@1.8.5" has incorrect peer dependency "react-dom@^15.0.0 || ^16.0.0".
    warning "recharts > react-resize-detector@2.3.0" has incorrect peer dependency "react@^0.14.7 || ^15.0.0 || ^16.0.0".
    warning "recharts > react-smooth@1.0.6" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
    warning "recharts > react-smooth@1.0.6" has incorrect peer dependency "react-dom@^15.0.0 || ^16.0.0".
    warning " > toasted-notes@3.2.0" has incorrect peer dependency "react@^16.8.4".
    warning " > toasted-notes@3.2.0" has incorrect peer dependency "react-dom@^16.8.4".
    warning "toasted-notes > @reach/alert@0.1.5" has incorrect peer dependency "react@^16.8.0".
    warning "toasted-notes > @reach/alert@0.1.5" has incorrect peer dependency "react-dom@^16.8.0".
    warning "toasted-notes > @reach/alert > @reach/component-component@0.1.3" has unmet peer dependency "prop-types@^15.6.2".
    warning "toasted-notes > @reach/alert > @reach/component-component@0.1.3" has incorrect peer dependency "react@^16.4.0".
    warning "toasted-notes > @reach/alert > @reach/component-component@0.1.3" has incorrect peer dependency "react-dom@^16.4.0".
    warning "toasted-notes > @reach/alert > @reach/visually-hidden@0.1.4" has incorrect peer dependency "react@^16.8.0".
    warning "toasted-notes > @reach/alert > @reach/visually-hidden@0.1.4" has incorrect peer dependency "react-dom@^16.8.0".
    warning " > @nomiclabs/hardhat-ethers@2.0.2" has unmet peer dependency "ethers@^5.0.0".
    warning " > @phenomnomnominal/tsquery@4.0.0" has incorrect peer dependency "typescript@^3".
    warning " > @pmmmwh/react-refresh-webpack-plugin@0.4.3" has incorrect peer dependency "react-refresh@>=0.8.3 <0.10.0".
    warning "@storybook/addon-actions > @storybook/api > @reach/router@1.3.4" has incorrect peer dependency "react@15.x || 16.x || 16.4.0-alpha.0911da3".
    warning "@storybook/addon-actions > @storybook/api > @reach/router@1.3.4" has incorrect peer dependency "react-dom@15.x || 16.x || 16.4.0-alpha.0911da3".
    warning " > @storybook/addon-storyshots@6.2.9" has unmet peer dependency "svelte@*".
    warning " > @storybook/addon-storyshots@6.2.9" has unmet peer dependency "vue-jest@*".
    warning "@storybook/addon-storyshots > react-test-renderer@17.0.1" has incorrect peer dependency "react@17.0.1".
    warning " > react-inlinesvg@2.0.1" has incorrect peer dependency "react@^16.8.0".
    warning "react-inlinesvg > react-from-dom@0.4.2" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
    [5/5] 🔨  Building fresh packages...
    Done in 110.08s.
  3. Run yarn start, receive Module not found error:
    yarn start
    
    yarn run v1.22.19
    $  yarn run dev
    $ check-node-version --package
    $ cross-env NODE_ENV=development TARGET_ENV=local webpack-dev-server --config webpack_config/development.js
    Failed to load ./.env.example.
    Starting type checking service...
    Using 1 worker with 2048MB memory limit
    ℹ 「wds」: Generating SSL Certificate
    ℹ 「wds」: Project is running at https://localhost:3000/
    ℹ 「wds」: webpack output is served from /
    ℹ 「wds」: Content not from webpack is served from /Volumes/My HD/Users/some-user/Documents/MyCrypto
    ℹ 「wds」: 404s will fallback to /index.html
    Browserslist: caniuse-lite is outdated. Please run:
    npx browserslist@latest --update-db
    
    Why you should do it regularly:
    https://github.com/browserslist/browserslist#browsers-data-updating
    Type checking in progress...
     ERROR  Failed to compile with 1 errors                                                                                                                                                             10:16:42 PM
    
    This dependency was not found:
    
    * fs in ./node_modules/dotenv/lib/main.js
    
    To install it, you can run: npm install --save fs
    Webpack Bundle Analyzer is started at http://127.0.0.1:8888
    Use Ctrl+C to close it
    ✖ 「wdm」:
    ERROR in ./node_modules/dotenv/lib/main.js
    Module not found: Error: Can't resolve 'fs' in '/Volumes/My HD/Users/some-user/Documents/MyCrypto/node_modules/dotenv/lib'
     @ ./node_modules/dotenv/lib/main.js 24:11-24
     @ ./node_modules/gridplus-sdk/dist/index.js
     @ ./node_modules/@mycrypto/wallets/lib/es/implementations/deterministic/gridplus.js
     @ ./node_modules/@mycrypto/wallets/lib/es/implementations/deterministic/index.js
     @ ./node_modules/@mycrypto/wallets/lib/es/implementations/index.js
     @ ./node_modules/@mycrypto/wallets/lib/es/index.js
     @ ./src/services/Store/store/persist.config.ts
     @ ./src/services/Store/store/root.reducer.ts
     @ ./src/services/Store/store/asset.slice.ts
     @ ./src/services/Store/store/account.slice.ts
     @ ./src/services/Store/store/nft.slice.ts
     @ ./src/services/Store/store/index.ts
     @ ./src/index.tsx
     @ multi ./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js ./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ErrorOverlayEntry.js ./src/index.tsx
    ℹ 「wdm」: Failed to compile.
    No type errors found
    Version: typescript 4.1.2
    Time: 81352ms
  4. Try to access http://localhost:3000, receive error:

    image

Description of Your Machine

  • Browser: Chrome 103.0.5060.134
  • Operating system: Mac OS Catalina 10.15.7
  • MyCrypto.com: Running from source
  • MyCrypto Version Number: 457ec2f0a1cce537275c3b67d7e871f1ae3ae162
  • Node version: 12.14.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions