Monday, 1 May 2017

WARNING: Could not read file on npm run build

I am trying to deploy my React App to S3 but I get WARNING: Could not read C:/Users/*/my-app/app/actions when I build my app.

Everything is working when I run it locally using npm start.

These are the following things I tried but did not solve the problem:

  • Updated the Packages
  • Deleted the node_modules directory, cleaned cache, installed packages again
  • Change app dir to 'app'
  • Change publicPath to s3 instance

These are my classes.

package.json

`...
"scripts": {
    "start": "nodemon --watch webpack.config.js --exec \"webpack-dev-server --env development\"",
    "build": "webpack --env production",
...`

webpack.config.js

`...
const PATHS = {
  app: path.join(__dirname, 'app/'),
  style: [
    path.join(__dirname, 'app/style', 'app.css'),
  ],
  build: path.join(__dirname, 'build'),
};
...
entry: {
      app: [
        'bootstrap-loader',
        PATHS.app,
      ],
      style: PATHS.style,
    },
    output: {
      path: PATHS.build,
      publicPath: '/',
      filename: '[name].js',
    },
    resolve: {
      extensions: ['.actions.js','.component.jsx','.container.js','.reducer.js','.js', '.jsx'],
    },
...
`

How can I successfully deploy this to S3? Any help is appreciated.



via Reactor

No comments:

Post a Comment