flood
flood copied to clipboard
ELIFECYCLE error on "npm run build"
Type: Bug Report
Your Environment
- Version used:
- v1.0.0
- Commit bb553506a86225811a965563af99bf8e39cc433f
- Environment name and version:
- Node.js version v13.2.0
- npm version 6.12.1
- Operating System and version: Arch Linux (kernel 5.3.13-arch1-1)
Summary
This happened when I tried to update the package after performing a system update, and my first thought was something got out of sync/corrupted, so I completely deleted my clone of the flood repo and tried a fresh install. Still occurs.
Creating an optimized production build...
Failed to compile.
./client/src/sass/style.scss (./node_modules/css-loader/dist/cjs.js??ref--5-1!./client/scripts/typed-css-modules-loader.js!./node_modules/postcss-loader/lib??postcss!./node_modules/sass-loader/dist/cjs.js??ref--5-4!./client/src/sass/style.scss)
TypeError: DtsCreator is not a constructor
@ ./client/src/sass/style.scss 2:14-251
@ ./client/src/javascript/app.tsx
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: 'node client/scripts/build.js'
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! /home/flint/.npm/_logs/2019-11-26T16_57_43_846Z-debug.log
/home/flint/.npm/_logs/2019-11-26T16_57_43_846Z-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/flint/flood/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
9 verbose lifecycle [email protected]~build: CWD: /home/flint/flood
10 silly lifecycle [email protected]~build: Args: [ '-c', 'node client/scripts/build.js' ]
11 silly lifecycle [email protected]~build: Returned: code: 1 signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: 'node client/scripts/build.js'
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:210:5)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:210:5)
13 verbose stack at maybeClose (internal/child_process.js:1023:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:281:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/flint/flood
16 verbose Linux 5.3.13-arch1-1
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v13.2.0
19 verbose npm v6.12.1
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: 'node client/scripts/build.js'
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Steps to Reproduce
- Attempt to follow the Compiling assets and starting the server section after doing a fresh clone or pulling updates
- After running npm run build, observe the above error output 2019-11-26T16_57_43_846Z-debug.log
This error only occurs if you run "npm audit fix". If you skip it and run "npm install" and then "npm run build" it completes succesfully. Strangely before audit fix caused no such issues...
I noticed an error when installing node-sass on my debian buster box too. To install okay i needed to run "npm install node-sass" separatelly.
I'm running into the same issue. I was able to install node-sass separately and clear that error, but I'm also getting npm dependency unmet errors on eslint, eslint-plugin-jsx-a11y and eslint-config-react-app.
rm -rf /path/to/flood/node_modules then npm install again. If that doesn't work, try rm -rf ~/.npm as well.
I rebuilt node-sass as well, but I don't think that was required.
I was getting this same error. After following JonFlowerful's tips I wasn't successful at removing the new packages/updates. I am not familiar with JS at all, but I managed to fix the issue. I edited line 2 in ./client/scripts/typed-css-modules-loader.js .
The original line:
const DtsCreator = require('typed-css-modules');
My edited version:
const DtsCreator = require('typed-css-modules').default;
I was then able to build it successfully with the audit fix. I'm not sure where or if I should report this.
addition to @JohnFlowerful comment
don't forget to roll package.json file back.