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 running npm install in preact dependency.

See original GitHub issue

Hi,

I’m used to using React but decided to give preact a go, along with the preact material ui components. It seems awesome so far…

When I installed both preact along with the jsx babel transform, things went ok. When I installed preact-material-components as well, and imported a single component directly:

import Button from 'preact-material-components/Button';

preact complained about the lack of the transform-object-rest-spread transform.

I could install this directly in my folder but i’d assume that preact should handle those deps. And declare them in the package.json browserify transform options.

I had to do an npm install within the node_modules/preact folder - but this then failed as at the end of the install the preact build command fails ( as there was a lack of config folder ) as its not included in the default npm install.

So i had to clone the preact repo directly in my node_modules and run install to get things working. Not ideal - but just thought i would ask if this was all expected behaviour! 😃

Cheers,

Jamie

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
developitcommented, Aug 22, 2017

Hmm - that is funky yeah. The git checkout freaks me out a bit - maybe cp it to a dotfile and then back?

  "prepublishOnly": "cp package.json .package.json; node prepublish.js",
  "postpublish": "mv -f .package.json package.json"
0reactions
rubenmoyacommented, Aug 21, 2017

The only thing I don’t like is the package.json is still modified after the code has been published, maybe doing something like:

  "prepublishOnly": "node prepublish.js",
  "postpublish": "git checkout package.json"

what do you think? unless you don’t mind doing a manual checkout after every publish

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error running npm install in preact dependency. #820 - GitHub
Hi, I'm used to using React but decided to give preact a go, along with the preact material ui components. It seems awesome...
Read more >
Why is preact not getting recognized in the terminal even after ...
First, I went to the official website of PreactJS. The doc says that I have to run npm install -g preact-cli . As...
Read more >
preact - npm
Start using preact in your project by running `npm i preact`. There are 1525 other projects in the npm registry using preact.
Read more >
Switching to Preact (from React)
With those dependencies installed, configure your build system to alias React imports so they point to ... First, install the transform: npm i...
Read more >
Common Error Details - Snowpack
When installing packages from npm, you may encounter some file formats that can run only with additional parsing/processing. First check to see if...
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