question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on `npm install`

See original GitHub issue

Trying to npm install in a freshly-pulled repository throws:

SyntaxError: <…>/draft-js/src/component/base/DraftEditor.react.js: Missing class properties transform.

Full log:

https://gist.github.com/kangax/f02a97fca90c6b1b8b01a70259bea3b5

Could it be that https://babeljs.io/docs/plugins/transform-class-properties is somehow missing from installed dependencies?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kangaxcommented, Jan 6, 2017

Just checked clean install (not as submodule) and, as expected, npm install works. So it must be something about the fact that it’s under another repo that throws flow off?

@gabelevi any idea what it could be?

0reactions
fisxcommented, May 18, 2017

oh, wait. gulpfile.js is generated. if i change it and then run gulp, gulp passes.

so where else should i add the plugins if not to gulpfile.js?

this works. thanks! (-:

$ git diff
diff --git a/gulpfile.js b/gulpfile.js
index 5ddc4da..8314519 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -43,6 +43,7 @@ var paths = {
 };
 
 var babelOptsJS = {
+  plugins: ['transform-class-properties'],
   presets: [
     fbjsConfigurePreset({
       stripDEV: true,
@@ -52,6 +53,7 @@ var babelOptsJS = {
 };
 
 var babelOptsFlow = {
+  plugins: ['transform-class-properties'],
   presets: [
     fbjsConfigurePreset({
       target: 'flow',
diff --git a/scripts/jest/preprocessor.js b/scripts/jest/preprocessor.js
index b9ea9fa..38c0499 100644
--- a/scripts/jest/preprocessor.js
+++ b/scripts/jest/preprocessor.js
@@ -16,6 +16,7 @@ var path = require('path');
 module.exports = {
   process(src, filename) {
     var options = {
+      plugins: ['transform-class-properties'],
       presets: [fbjsConfigurePreset({rewriteModules: {map: moduleMap}})],
       filename: filename,
       retainLines: true,
Read more comments on GitHub >

github_iconTop Results From Across the Web

Common errors | npm Docs
Possible temporary npm registry glitch, or corrupted local server cache. Run npm cache clean and/or try again later. · This can be caused...
Read more >
npm install error from the terminal - Stack Overflow
Running just "npm install" will look for dependencies listed in your package.json. The error you're getting says that you don't have a package.json...
Read more >
How to solve npm ERR! code 1 when running npm install
Fix npm error code 1 by updating your dependencies · Update one package version in package.json file · Then run npm install ·...
Read more >
NPM install error - Material Design for Bootstrap
Trying to install MDB pro 4.19.2 just downloaded and ran npm install but getting this error of sha512 not matching. Can someone tell...
Read more >
How to Solve the Angular NPM Error - C# Corner
The error in NPM, 'error package install failed, see above', can occur when the user creates a new project in Angular using Node.js...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found