jonschlinkert / merge-deep

Recursively merge values in a JavaScript object.

Home Page:https://github.com/jonschlinkert

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot find module 'kind-of'

wenshan opened this issue · comments

Cannot find module 'kind-of'

Please be more specific. Show some code to reproduce the error and the error stack.

Also, make sure to clear the npm cache and reinstall since this is usually the issue:

# delete node_modules folder
$ rm -fr node_modules
# clear npm cache
$ npm cache clear
# install `merge-deep`
$ npm install merge-deep

yeah this is definitely a caching issue. just delete node_modules and reinstall everything. closing since the issue is not related to this project

Still get hit by this. Coming from a clean install. I've cleared all caches, removed node_modules and re-installed everything. Multiple times.

Don't have time to look into this right now, but if I were to guess, I think it could have something to do with either different versions of kind-of being depended upon (I already had version 6.x installed and this package depends upon 3.x) or some incompatibility with CommonJS/ESM modules.

For the time being, I've resorted to use another library. A shame, cause I liked how minimal this was.

If the assumption above is correct, merging #13 and #14 might do the trick.

Removing nodemodules didn't solve the problem.

Also encountered this problem with fresh node_modules

bundling with webpack against merge-deep@3.0.2

cc @jonschlinkert

bundling with webpack

This is the first time anyone mentioned webpack...

However, no one has provided any more information (e.g. the code using merge-deep, their bundler config, an error stack trace, etc...)

I ran into this problem with create-react-app + yarn workspaces + typescript (TS config: "esModuleInterop": true, "allowSyntheticDefaultImports": true)

I tried importing like this

import merge from 'merge-deep'
// and also
const merge = require('merge-deep')

... on the other hand when I used it in node.js + typescript and imprted like so

const merge = require('merge-deep')

it worked fine