Receiving an npm error after running “npm run build” : npm ERR! code ELIFECYCLE npm ERR! errno 2









up vote
0
down vote

favorite












I am having difficulty getting to the bottom of this npm error I am receiving after my npm run build script executes. The error in the terminal is as follows:



npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! vincent-site@1.0.0 build: `webpack --mode production`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the vincent-site@1.0.0 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/vincentcastelli/.npm/_logs/2018-11-10T20_27_41_388Z-debug.


Not very descriptive. I am using the most recent npm version at the time of writing this (6.4.1) and the most recent node (11.1.0). I am also using Babel 7 with Webpack 4 for my compiling. I have tried a few things so far.



I have tried the following steps when using both the recent version of npm/node and older versions:



  1. npm cache clean --force

  2. delete node_modules by $ rm -rf node_modules folder

  3. npm install

Still receiving the error.



My log output:



0 info it worked if it ends with ok
1 verbose cli [ '/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/node',
1 verbose cli '/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using npm@6.4.1
3 info using node@v11.1.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle vincent-site@1.0.0~prebuild: vincent-site@1.0.0
6 info lifecycle vincent-site@1.0.0~build: vincent-site@1.0.0
7 verbose lifecycle vincent-site@1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle vincent-site@1.0.0~build: PATH: /Users/vincentcastelli/.nvm/versions/node/v11.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/vincentcastelli/Documents/02_Projects/vincent-site/node_modules/.bin:/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
9 verbose lifecycle vincent-site@1.0.0~build: CWD: /Users/vincentcastelli/Documents/02_Projects/vincent-site
10 silly lifecycle vincent-site@1.0.0~build: Args: [ '-c', 'webpack --mode production' ]
11 silly lifecycle vincent-site@1.0.0~build: Returned: code: 2 signal: null
12 info lifecycle vincent-site@1.0.0~build: Failed to exec build script
13 verbose stack Error: vincent-site@1.0.0 build: `webpack --mode production`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (/Users/vincentcastelli/.nvm/versions/node/v11.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (/Users/vincentcastelli/.nvm/versions/node/v11.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:257:5)
14 verbose pkgid vincent-site@1.0.0
15 verbose cwd /Users/vincentcastelli/Documents/02_Projects/vincent-site
16 verbose Darwin 18.0.0
17 verbose argv "/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/node" "/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/npm" "run" "build"
18 verbose node v11.1.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 2
22 error vincent-site@1.0.0 build: `webpack --mode production`
22 error Exit status 2
23 error Failed at the vincent-site@1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]


My package.json:



}
"scripts":
"start": "node server.js",
"build": "webpack --mode production"
,
"dependencies":
"body-parser": "^1.18.3",
"express": "^4.16.3",
"prop-types": "^15.6.1",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-router-dom": "^4.3.1"
,
"engines":
"node": "10.13.0"
,
"babel":
"presets": [
"@babel/preset-env",
"@babel/react"
],
"plugins": [
"@babel/proposal-class-properties"
]
,
"eslintConfig":
"extends": "airbnb",
"parser": "babel-eslint"
,
"devDependencies":
"@babel/core": "^7.1.5",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/preset-env": "^7.1.5",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.4",
"css-loader": "^1.0.1",
"eslint": "^5.9.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-loader": "^2.1.1",
"eslint-plugin-ejs": "0.0.2",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1",
"file-loader": "^2.0.0",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"node-sass": "^4.10.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"webpack": "^4.25.1",
"webpack-cli": "^3.1.2"

}


My webpack config:



const path = require('path');
const HtmlWebPackPlugin = require("html-webpack-plugin");

const distDir = path.join(__dirname, '/dist');
const srcDir = path.join(__dirname, '/src');


module.exports =
entry: `$srcDir/index.jsx`,
output:
path: `$distDir`,
filename: 'bundle.js',
,
module:
rules: [

test: /.(js,

test: /.html$/,
use: [

loader: "html-loader"

]
,

test: /.scss$/,
use: [
"style-loader",
"css-loader",
"sass-loader"
]
,
webm)$/,
use: 'file-loader',
,
],
,
plugins: [
new HtmlWebPackPlugin(
template: "./dist/index.html",
filename: "./index.html"
)
],
resolve: extensions: ['*', '.js', '.jsx'] ,
devtool: 'cheap-eval-source-map',
;


I feel that the issue stems from a package versioning incompatibility but isolating the issue has been challenging. Thank you in advance for the assistance!










share|improve this question

























    up vote
    0
    down vote

    favorite












    I am having difficulty getting to the bottom of this npm error I am receiving after my npm run build script executes. The error in the terminal is as follows:



    npm ERR! code ELIFECYCLE
    npm ERR! errno 2
    npm ERR! vincent-site@1.0.0 build: `webpack --mode production`
    npm ERR! Exit status 2
    npm ERR!
    npm ERR! Failed at the vincent-site@1.0.0 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/vincentcastelli/.npm/_logs/2018-11-10T20_27_41_388Z-debug.


    Not very descriptive. I am using the most recent npm version at the time of writing this (6.4.1) and the most recent node (11.1.0). I am also using Babel 7 with Webpack 4 for my compiling. I have tried a few things so far.



    I have tried the following steps when using both the recent version of npm/node and older versions:



    1. npm cache clean --force

    2. delete node_modules by $ rm -rf node_modules folder

    3. npm install

    Still receiving the error.



    My log output:



    0 info it worked if it ends with ok
    1 verbose cli [ '/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/node',
    1 verbose cli '/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/npm',
    1 verbose cli 'run',
    1 verbose cli 'build' ]
    2 info using npm@6.4.1
    3 info using node@v11.1.0
    4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
    5 info lifecycle vincent-site@1.0.0~prebuild: vincent-site@1.0.0
    6 info lifecycle vincent-site@1.0.0~build: vincent-site@1.0.0
    7 verbose lifecycle vincent-site@1.0.0~build: unsafe-perm in lifecycle true
    8 verbose lifecycle vincent-site@1.0.0~build: PATH: /Users/vincentcastelli/.nvm/versions/node/v11.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/vincentcastelli/Documents/02_Projects/vincent-site/node_modules/.bin:/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
    9 verbose lifecycle vincent-site@1.0.0~build: CWD: /Users/vincentcastelli/Documents/02_Projects/vincent-site
    10 silly lifecycle vincent-site@1.0.0~build: Args: [ '-c', 'webpack --mode production' ]
    11 silly lifecycle vincent-site@1.0.0~build: Returned: code: 2 signal: null
    12 info lifecycle vincent-site@1.0.0~build: Failed to exec build script
    13 verbose stack Error: vincent-site@1.0.0 build: `webpack --mode production`
    13 verbose stack Exit status 2
    13 verbose stack at EventEmitter.<anonymous> (/Users/vincentcastelli/.nvm/versions/node/v11.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
    13 verbose stack at EventEmitter.emit (events.js:182:13)
    13 verbose stack at ChildProcess.<anonymous> (/Users/vincentcastelli/.nvm/versions/node/v11.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
    13 verbose stack at ChildProcess.emit (events.js:182:13)
    13 verbose stack at maybeClose (internal/child_process.js:970:16)
    13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:257:5)
    14 verbose pkgid vincent-site@1.0.0
    15 verbose cwd /Users/vincentcastelli/Documents/02_Projects/vincent-site
    16 verbose Darwin 18.0.0
    17 verbose argv "/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/node" "/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/npm" "run" "build"
    18 verbose node v11.1.0
    19 verbose npm v6.4.1
    20 error code ELIFECYCLE
    21 error errno 2
    22 error vincent-site@1.0.0 build: `webpack --mode production`
    22 error Exit status 2
    23 error Failed at the vincent-site@1.0.0 build script.
    23 error This is probably not a problem with npm. There is likely additional logging output above.
    24 verbose exit [ 2, true ]


    My package.json:



    }
    "scripts":
    "start": "node server.js",
    "build": "webpack --mode production"
    ,
    "dependencies":
    "body-parser": "^1.18.3",
    "express": "^4.16.3",
    "prop-types": "^15.6.1",
    "react": "^16.5.2",
    "react-dom": "^16.5.2",
    "react-router-dom": "^4.3.1"
    ,
    "engines":
    "node": "10.13.0"
    ,
    "babel":
    "presets": [
    "@babel/preset-env",
    "@babel/react"
    ],
    "plugins": [
    "@babel/proposal-class-properties"
    ]
    ,
    "eslintConfig":
    "extends": "airbnb",
    "parser": "babel-eslint"
    ,
    "devDependencies":
    "@babel/core": "^7.1.5",
    "@babel/plugin-proposal-class-properties": "^7.1.0",
    "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
    "@babel/preset-env": "^7.1.5",
    "@babel/preset-react": "^7.0.0",
    "babel-eslint": "^10.0.1",
    "babel-loader": "^8.0.4",
    "css-loader": "^1.0.1",
    "eslint": "^5.9.0",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-loader": "^2.1.1",
    "eslint-plugin-ejs": "0.0.2",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-jsx-a11y": "^6.1.2",
    "eslint-plugin-react": "^7.11.1",
    "file-loader": "^2.0.0",
    "html-loader": "^0.5.5",
    "html-webpack-plugin": "^3.2.0",
    "node-sass": "^4.10.0",
    "sass-loader": "^7.1.0",
    "style-loader": "^0.23.1",
    "webpack": "^4.25.1",
    "webpack-cli": "^3.1.2"

    }


    My webpack config:



    const path = require('path');
    const HtmlWebPackPlugin = require("html-webpack-plugin");

    const distDir = path.join(__dirname, '/dist');
    const srcDir = path.join(__dirname, '/src');


    module.exports =
    entry: `$srcDir/index.jsx`,
    output:
    path: `$distDir`,
    filename: 'bundle.js',
    ,
    module:
    rules: [

    test: /.(js,

    test: /.html$/,
    use: [

    loader: "html-loader"

    ]
    ,

    test: /.scss$/,
    use: [
    "style-loader",
    "css-loader",
    "sass-loader"
    ]
    ,
    webm)$/,
    use: 'file-loader',
    ,
    ],
    ,
    plugins: [
    new HtmlWebPackPlugin(
    template: "./dist/index.html",
    filename: "./index.html"
    )
    ],
    resolve: extensions: ['*', '.js', '.jsx'] ,
    devtool: 'cheap-eval-source-map',
    ;


    I feel that the issue stems from a package versioning incompatibility but isolating the issue has been challenging. Thank you in advance for the assistance!










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am having difficulty getting to the bottom of this npm error I am receiving after my npm run build script executes. The error in the terminal is as follows:



      npm ERR! code ELIFECYCLE
      npm ERR! errno 2
      npm ERR! vincent-site@1.0.0 build: `webpack --mode production`
      npm ERR! Exit status 2
      npm ERR!
      npm ERR! Failed at the vincent-site@1.0.0 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/vincentcastelli/.npm/_logs/2018-11-10T20_27_41_388Z-debug.


      Not very descriptive. I am using the most recent npm version at the time of writing this (6.4.1) and the most recent node (11.1.0). I am also using Babel 7 with Webpack 4 for my compiling. I have tried a few things so far.



      I have tried the following steps when using both the recent version of npm/node and older versions:



      1. npm cache clean --force

      2. delete node_modules by $ rm -rf node_modules folder

      3. npm install

      Still receiving the error.



      My log output:



      0 info it worked if it ends with ok
      1 verbose cli [ '/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/node',
      1 verbose cli '/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/npm',
      1 verbose cli 'run',
      1 verbose cli 'build' ]
      2 info using npm@6.4.1
      3 info using node@v11.1.0
      4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
      5 info lifecycle vincent-site@1.0.0~prebuild: vincent-site@1.0.0
      6 info lifecycle vincent-site@1.0.0~build: vincent-site@1.0.0
      7 verbose lifecycle vincent-site@1.0.0~build: unsafe-perm in lifecycle true
      8 verbose lifecycle vincent-site@1.0.0~build: PATH: /Users/vincentcastelli/.nvm/versions/node/v11.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/vincentcastelli/Documents/02_Projects/vincent-site/node_modules/.bin:/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
      9 verbose lifecycle vincent-site@1.0.0~build: CWD: /Users/vincentcastelli/Documents/02_Projects/vincent-site
      10 silly lifecycle vincent-site@1.0.0~build: Args: [ '-c', 'webpack --mode production' ]
      11 silly lifecycle vincent-site@1.0.0~build: Returned: code: 2 signal: null
      12 info lifecycle vincent-site@1.0.0~build: Failed to exec build script
      13 verbose stack Error: vincent-site@1.0.0 build: `webpack --mode production`
      13 verbose stack Exit status 2
      13 verbose stack at EventEmitter.<anonymous> (/Users/vincentcastelli/.nvm/versions/node/v11.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
      13 verbose stack at EventEmitter.emit (events.js:182:13)
      13 verbose stack at ChildProcess.<anonymous> (/Users/vincentcastelli/.nvm/versions/node/v11.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
      13 verbose stack at ChildProcess.emit (events.js:182:13)
      13 verbose stack at maybeClose (internal/child_process.js:970:16)
      13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:257:5)
      14 verbose pkgid vincent-site@1.0.0
      15 verbose cwd /Users/vincentcastelli/Documents/02_Projects/vincent-site
      16 verbose Darwin 18.0.0
      17 verbose argv "/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/node" "/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/npm" "run" "build"
      18 verbose node v11.1.0
      19 verbose npm v6.4.1
      20 error code ELIFECYCLE
      21 error errno 2
      22 error vincent-site@1.0.0 build: `webpack --mode production`
      22 error Exit status 2
      23 error Failed at the vincent-site@1.0.0 build script.
      23 error This is probably not a problem with npm. There is likely additional logging output above.
      24 verbose exit [ 2, true ]


      My package.json:



      }
      "scripts":
      "start": "node server.js",
      "build": "webpack --mode production"
      ,
      "dependencies":
      "body-parser": "^1.18.3",
      "express": "^4.16.3",
      "prop-types": "^15.6.1",
      "react": "^16.5.2",
      "react-dom": "^16.5.2",
      "react-router-dom": "^4.3.1"
      ,
      "engines":
      "node": "10.13.0"
      ,
      "babel":
      "presets": [
      "@babel/preset-env",
      "@babel/react"
      ],
      "plugins": [
      "@babel/proposal-class-properties"
      ]
      ,
      "eslintConfig":
      "extends": "airbnb",
      "parser": "babel-eslint"
      ,
      "devDependencies":
      "@babel/core": "^7.1.5",
      "@babel/plugin-proposal-class-properties": "^7.1.0",
      "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
      "@babel/preset-env": "^7.1.5",
      "@babel/preset-react": "^7.0.0",
      "babel-eslint": "^10.0.1",
      "babel-loader": "^8.0.4",
      "css-loader": "^1.0.1",
      "eslint": "^5.9.0",
      "eslint-config-airbnb": "^17.1.0",
      "eslint-loader": "^2.1.1",
      "eslint-plugin-ejs": "0.0.2",
      "eslint-plugin-import": "^2.14.0",
      "eslint-plugin-jsx-a11y": "^6.1.2",
      "eslint-plugin-react": "^7.11.1",
      "file-loader": "^2.0.0",
      "html-loader": "^0.5.5",
      "html-webpack-plugin": "^3.2.0",
      "node-sass": "^4.10.0",
      "sass-loader": "^7.1.0",
      "style-loader": "^0.23.1",
      "webpack": "^4.25.1",
      "webpack-cli": "^3.1.2"

      }


      My webpack config:



      const path = require('path');
      const HtmlWebPackPlugin = require("html-webpack-plugin");

      const distDir = path.join(__dirname, '/dist');
      const srcDir = path.join(__dirname, '/src');


      module.exports =
      entry: `$srcDir/index.jsx`,
      output:
      path: `$distDir`,
      filename: 'bundle.js',
      ,
      module:
      rules: [

      test: /.(js,

      test: /.html$/,
      use: [

      loader: "html-loader"

      ]
      ,

      test: /.scss$/,
      use: [
      "style-loader",
      "css-loader",
      "sass-loader"
      ]
      ,
      webm)$/,
      use: 'file-loader',
      ,
      ],
      ,
      plugins: [
      new HtmlWebPackPlugin(
      template: "./dist/index.html",
      filename: "./index.html"
      )
      ],
      resolve: extensions: ['*', '.js', '.jsx'] ,
      devtool: 'cheap-eval-source-map',
      ;


      I feel that the issue stems from a package versioning incompatibility but isolating the issue has been challenging. Thank you in advance for the assistance!










      share|improve this question













      I am having difficulty getting to the bottom of this npm error I am receiving after my npm run build script executes. The error in the terminal is as follows:



      npm ERR! code ELIFECYCLE
      npm ERR! errno 2
      npm ERR! vincent-site@1.0.0 build: `webpack --mode production`
      npm ERR! Exit status 2
      npm ERR!
      npm ERR! Failed at the vincent-site@1.0.0 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/vincentcastelli/.npm/_logs/2018-11-10T20_27_41_388Z-debug.


      Not very descriptive. I am using the most recent npm version at the time of writing this (6.4.1) and the most recent node (11.1.0). I am also using Babel 7 with Webpack 4 for my compiling. I have tried a few things so far.



      I have tried the following steps when using both the recent version of npm/node and older versions:



      1. npm cache clean --force

      2. delete node_modules by $ rm -rf node_modules folder

      3. npm install

      Still receiving the error.



      My log output:



      0 info it worked if it ends with ok
      1 verbose cli [ '/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/node',
      1 verbose cli '/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/npm',
      1 verbose cli 'run',
      1 verbose cli 'build' ]
      2 info using npm@6.4.1
      3 info using node@v11.1.0
      4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
      5 info lifecycle vincent-site@1.0.0~prebuild: vincent-site@1.0.0
      6 info lifecycle vincent-site@1.0.0~build: vincent-site@1.0.0
      7 verbose lifecycle vincent-site@1.0.0~build: unsafe-perm in lifecycle true
      8 verbose lifecycle vincent-site@1.0.0~build: PATH: /Users/vincentcastelli/.nvm/versions/node/v11.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/vincentcastelli/Documents/02_Projects/vincent-site/node_modules/.bin:/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
      9 verbose lifecycle vincent-site@1.0.0~build: CWD: /Users/vincentcastelli/Documents/02_Projects/vincent-site
      10 silly lifecycle vincent-site@1.0.0~build: Args: [ '-c', 'webpack --mode production' ]
      11 silly lifecycle vincent-site@1.0.0~build: Returned: code: 2 signal: null
      12 info lifecycle vincent-site@1.0.0~build: Failed to exec build script
      13 verbose stack Error: vincent-site@1.0.0 build: `webpack --mode production`
      13 verbose stack Exit status 2
      13 verbose stack at EventEmitter.<anonymous> (/Users/vincentcastelli/.nvm/versions/node/v11.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
      13 verbose stack at EventEmitter.emit (events.js:182:13)
      13 verbose stack at ChildProcess.<anonymous> (/Users/vincentcastelli/.nvm/versions/node/v11.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
      13 verbose stack at ChildProcess.emit (events.js:182:13)
      13 verbose stack at maybeClose (internal/child_process.js:970:16)
      13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:257:5)
      14 verbose pkgid vincent-site@1.0.0
      15 verbose cwd /Users/vincentcastelli/Documents/02_Projects/vincent-site
      16 verbose Darwin 18.0.0
      17 verbose argv "/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/node" "/Users/vincentcastelli/.nvm/versions/node/v11.1.0/bin/npm" "run" "build"
      18 verbose node v11.1.0
      19 verbose npm v6.4.1
      20 error code ELIFECYCLE
      21 error errno 2
      22 error vincent-site@1.0.0 build: `webpack --mode production`
      22 error Exit status 2
      23 error Failed at the vincent-site@1.0.0 build script.
      23 error This is probably not a problem with npm. There is likely additional logging output above.
      24 verbose exit [ 2, true ]


      My package.json:



      }
      "scripts":
      "start": "node server.js",
      "build": "webpack --mode production"
      ,
      "dependencies":
      "body-parser": "^1.18.3",
      "express": "^4.16.3",
      "prop-types": "^15.6.1",
      "react": "^16.5.2",
      "react-dom": "^16.5.2",
      "react-router-dom": "^4.3.1"
      ,
      "engines":
      "node": "10.13.0"
      ,
      "babel":
      "presets": [
      "@babel/preset-env",
      "@babel/react"
      ],
      "plugins": [
      "@babel/proposal-class-properties"
      ]
      ,
      "eslintConfig":
      "extends": "airbnb",
      "parser": "babel-eslint"
      ,
      "devDependencies":
      "@babel/core": "^7.1.5",
      "@babel/plugin-proposal-class-properties": "^7.1.0",
      "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
      "@babel/preset-env": "^7.1.5",
      "@babel/preset-react": "^7.0.0",
      "babel-eslint": "^10.0.1",
      "babel-loader": "^8.0.4",
      "css-loader": "^1.0.1",
      "eslint": "^5.9.0",
      "eslint-config-airbnb": "^17.1.0",
      "eslint-loader": "^2.1.1",
      "eslint-plugin-ejs": "0.0.2",
      "eslint-plugin-import": "^2.14.0",
      "eslint-plugin-jsx-a11y": "^6.1.2",
      "eslint-plugin-react": "^7.11.1",
      "file-loader": "^2.0.0",
      "html-loader": "^0.5.5",
      "html-webpack-plugin": "^3.2.0",
      "node-sass": "^4.10.0",
      "sass-loader": "^7.1.0",
      "style-loader": "^0.23.1",
      "webpack": "^4.25.1",
      "webpack-cli": "^3.1.2"

      }


      My webpack config:



      const path = require('path');
      const HtmlWebPackPlugin = require("html-webpack-plugin");

      const distDir = path.join(__dirname, '/dist');
      const srcDir = path.join(__dirname, '/src');


      module.exports =
      entry: `$srcDir/index.jsx`,
      output:
      path: `$distDir`,
      filename: 'bundle.js',
      ,
      module:
      rules: [

      test: /.(js,

      test: /.html$/,
      use: [

      loader: "html-loader"

      ]
      ,

      test: /.scss$/,
      use: [
      "style-loader",
      "css-loader",
      "sass-loader"
      ]
      ,
      webm)$/,
      use: 'file-loader',
      ,
      ],
      ,
      plugins: [
      new HtmlWebPackPlugin(
      template: "./dist/index.html",
      filename: "./index.html"
      )
      ],
      resolve: extensions: ['*', '.js', '.jsx'] ,
      devtool: 'cheap-eval-source-map',
      ;


      I feel that the issue stems from a package versioning incompatibility but isolating the issue has been challenging. Thank you in advance for the assistance!







      node.js reactjs npm webpack node-sass






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 20:55









      Vincent Castelli

      12




      12






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          Step 1: $ npm cache clean --force



          Step 2: delete node_modules folder



          step 3: delete package-lock.json file



          Step 4: npm install



          To start again, $ npm run start or npm run build



          This worked for me. Hopes it works for you.






          share|improve this answer






















          • Thanks for the response, but this did not work and I am receiving the same error.
            – Vincent Castelli
            Nov 10 at 22:50










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243326%2freceiving-an-npm-error-after-running-npm-run-build-npm-err-code-elifecycle%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          Step 1: $ npm cache clean --force



          Step 2: delete node_modules folder



          step 3: delete package-lock.json file



          Step 4: npm install



          To start again, $ npm run start or npm run build



          This worked for me. Hopes it works for you.






          share|improve this answer






















          • Thanks for the response, but this did not work and I am receiving the same error.
            – Vincent Castelli
            Nov 10 at 22:50














          up vote
          1
          down vote













          Step 1: $ npm cache clean --force



          Step 2: delete node_modules folder



          step 3: delete package-lock.json file



          Step 4: npm install



          To start again, $ npm run start or npm run build



          This worked for me. Hopes it works for you.






          share|improve this answer






















          • Thanks for the response, but this did not work and I am receiving the same error.
            – Vincent Castelli
            Nov 10 at 22:50












          up vote
          1
          down vote










          up vote
          1
          down vote









          Step 1: $ npm cache clean --force



          Step 2: delete node_modules folder



          step 3: delete package-lock.json file



          Step 4: npm install



          To start again, $ npm run start or npm run build



          This worked for me. Hopes it works for you.






          share|improve this answer














          Step 1: $ npm cache clean --force



          Step 2: delete node_modules folder



          step 3: delete package-lock.json file



          Step 4: npm install



          To start again, $ npm run start or npm run build



          This worked for me. Hopes it works for you.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 11 at 22:00

























          answered Nov 10 at 22:04









          xeiton

          2216




          2216











          • Thanks for the response, but this did not work and I am receiving the same error.
            – Vincent Castelli
            Nov 10 at 22:50
















          • Thanks for the response, but this did not work and I am receiving the same error.
            – Vincent Castelli
            Nov 10 at 22:50















          Thanks for the response, but this did not work and I am receiving the same error.
          – Vincent Castelli
          Nov 10 at 22:50




          Thanks for the response, but this did not work and I am receiving the same error.
          – Vincent Castelli
          Nov 10 at 22:50

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243326%2freceiving-an-npm-error-after-running-npm-run-build-npm-err-code-elifecycle%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Top Tejano songwriter Luis Silva dead of heart attack at 64

          ReactJS Fetched API data displays live - need Data displayed static

          政党