mattermost / mattermost-redux

Redux for Mattermost

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

report redux utils not found error when build Mattermost-webapp

xiaotuanyu120 opened this issue · comments

Summary

report mattermost-redux/utils/user_utils.jsx not found error when build Mattermost-webapp

Environment Information

OS X 10.14.4

  • Webapp or React Native app: 5.9
  • Mattermost Server Version: 5.9
  • node version: 10.15.3&8.12.0

Steps to reproduce

cd /path/to/mattermost/mattermost-webapp/
sudo npm install --unsafe-perm --allow-root
sudo npm run build

Error detail

[/Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/mattermost-redux/utils/user_utils.jsx]
 @ ./components/user_settings/security/user_access_token_section/user_access_token_section.jsx 39:0-63 195:11-34
 @ ./components/user_settings/security/user_access_token_section/index.js
 @ ./components/user_settings/security/user_settings_security.jsx
 @ ./components/user_settings/security/index.js
 @ ./components/user_settings/user_settings.jsx
 @ ./node_modules/babel-loader/lib??ref--4!./components/user_settings/index.js
 @ ./node_modules/bundle-loader?lazy!./components/user_settings/index.js
 @ ./components/user_settings/modal/user_settings_modal.jsx
 @ ./components/user_settings/modal/index.js
 @ ./components/profile_popover/profile_popover.jsx
 @ ./components/profile_popover/index.js
 @ ./components/at_mention/at_mention.jsx
 @ ./components/at_mention/index.jsx
 @ ./utils/message_html_to_component.jsx
 @ ./plugins/export.js
 @ ./components/root/root.jsx
 @ ./node_modules/babel-loader/lib??ref--4!./components/root/index.js
 @ ./node_modules/bundle-loader?lazy!./components/root/index.js
 @ ./root.jsx
 @ multi @babel/polyfill whatwg-fetch url-search-params-polyfill ./root.jsx root.html

ERROR in ./utils/utils.jsx
Module not found: Error: Can't resolve 'mattermost-redux/utils/user_utils' in '/Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/utils'
resolve 'mattermost-redux/utils/user_utils' in '/Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/utils'
  Parsed request is a module
  using description file: /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/package.json (relative path: ./utils)
    resolve as module
      /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/utils/node_modules doesn't exist or is not a directory
      /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/utils/non_npm_dependencies doesn't exist or is not a directory
      /Users/zack/godev_centos_docker/go/src/github.com/mattermost/node_modules doesn't exist or is not a directory
      /Users/zack/godev_centos_docker/go/src/github.com/mattermost/non_npm_dependencies doesn't exist or is not a directory
      /Users/zack/godev_centos_docker/go/src/github.com/node_modules doesn't exist or is not a directory
      /Users/zack/godev_centos_docker/go/src/github.com/non_npm_dependencies doesn't exist or is not a directory
      /Users/zack/godev_centos_docker/go/src/node_modules doesn't exist or is not a directory
      /Users/zack/godev_centos_docker/go/src/non_npm_dependencies doesn't exist or is not a directory
      /Users/zack/godev_centos_docker/go/node_modules doesn't exist or is not a directory
      /Users/zack/godev_centos_docker/go/non_npm_dependencies doesn't exist or is not a directory
      /Users/zack/godev_centos_docker/node_modules doesn't exist or is not a directory
      /Users/zack/godev_centos_docker/non_npm_dependencies doesn't exist or is not a directory
      /Users/zack/node_modules doesn't exist or is not a directory
      /Users/zack/non_npm_dependencies doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /Users/non_npm_dependencies doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      /non_npm_dependencies doesn't exist or is not a directory
      looking for modules in /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/node_modules
        using description file: /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/package.json (relative path: ./node_modules)
          using description file: /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/node_modules/mattermost-redux/package.json (relative path: ./utils/user_utils)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/node_modules/mattermost-redux/utils/user_utils doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/node_modules/mattermost-redux/utils/user_utils.js doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
      looking for modules in /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/non_npm_dependencies
        using description file: /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/package.json (relative path: ./non_npm_dependencies)
          using description file: /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/package.json (relative path: ./non_npm_dependencies/mattermost-redux/utils/user_utils)
            no extension
              /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/non_npm_dependencies/mattermost-redux/utils/user_utils doesn't exist
              /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/node_modules/mattermost-redux/utils/user_utils.jsx doesn't exist
            .js
              /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/non_npm_dependencies/mattermost-redux/utils/user_utils.js doesn't exist
            as directory
              /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/node_modules/mattermost-redux/utils/user_utils doesn't exist
            .jsx
              /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/non_npm_dependencies/mattermost-redux/utils/user_utils.jsx doesn't exist
            as directory
              /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/non_npm_dependencies/mattermost-redux/utils/user_utils doesn't exist
      looking for modules in /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp
        using description file: /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/package.json (relative path: .)
          using description file: /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/package.json (relative path: ./mattermost-redux/utils/user_utils)
            no extension
              /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/mattermost-redux/utils/user_utils doesn't exist
            .js
              /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/mattermost-redux/utils/user_utils.js doesn't exist
            .jsx
              /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/mattermost-redux/utils/user_utils.jsx doesn't exist
            as directory
              /Users/zack/godev_centos_docker/go/src/github.com/mattermost/mattermost-webapp/mattermost-redux/utils/user_utils doesn't exist

Observed behavior





 checked the Mattermost-redux in node_modules, the utils folder is inside src, so the correct path is /path/to/mattermost/mattermost-webapp/node_modules/mattermost-redux/src/utils/user_utils.jsx

====================

update

its okay in my windows 10, and the path is correct in node_modules, such as /path/to/mattermost/mattermost-webapp/node_modules/mattermost-redux/utils/user_utils.jsx

solved on Mac os x

its okay after 

run npm cache clean --force on my Mac os X

solved finnally

# in mattermost-webapp folder
npm install

# go to install dependencies manually for mattermost-redux
cd node_modules/mattermost-redux
npm install
cd ../..

# then build success
npm run build

i tried the same to your solution but i still get error :( here is the error after run npm install in node_modules/mattermost-redux

image

This issue appears from version to version and each time requires new workaround; last time I installed MM before, it was enough to separately run npm install mattermost-redux after npm install in mattermost-webapp folder.

But now only this helped:

#in mattermost-webapp folder
npm install
cd node_modules/mattermost-redux
npm install
npm run build
cd ../..
npm run build