Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This dependency was not found: #170

Closed
1 of 2 tasks
LiZeC123 opened this issue Jul 28, 2019 · 5 comments
Closed
1 of 2 tasks

This dependency was not found: #170

LiZeC123 opened this issue Jul 28, 2019 · 5 comments

Comments

@LiZeC123
Copy link

Info

  • Operating System: Win 10
  • Node Version: v10.15.1
  • Browser Name and Version: Chrome 75.0.3770.142

Type

  • bug
  • feature request

For Bugs

I downloaded this project using npm yesterday. And I tried to start the sample code with npx, but got the following error message.

 ERROR  Failed to compile with 2 errors                                                                                                                         00:12:51

These dependencies were not found:

* \src\entryPoints\Client.js in multi webpack-hot-middleware/client?reload=true regenerator-runtime /src/entryPoints/Client.js ./index.js src/utils/customCss.js
* src\utils\customCss.js in multi webpack-hot-middleware/client?reload=true regenerator-runtime /src/entryPoints/Client.js ./index.js src/utils/customCss.js

To install them, you can run: npm install --save \src\entryPoints\Client.js src\utils\customCss.js

This seems to be missing some dependencies, but I have never used nodejs before, so I can't determine the specific reason. And in the installation process, there are still the following warnings

npm WARN [email protected] requires a peer of d3@^4.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

Because I don't know nodejs, I'm not sure if the above warning is the reason why the project can't run. Below is the full output during installation and operation

PS C:\Users\lizec\Documents\Blog\Fusuma> node -v
v10.15.1
PS C:\Users\lizec\Documents\Blog\Fusuma> npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (fusuma) myslides
version: (1.0.0)
description: None
entry point: (index.js)
test command:
git repository:
keywords:
author: LiZeC
license: (ISC) MIT
About to write to C:\Users\lizec\Documents\Blog\Fusuma\package.json:

{
  "name": "myslides",
  "version": "1.0.0",
  "description": "None",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "LiZeC",
  "license": "MIT"
}


Is this OK? (yes) yes
PS C:\Users\lizec\Documents\Blog\Fusuma> cat .\package.json
{
  "name": "myslides",
  "version": "1.0.0",
  "description": "None",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "LiZeC",
  "license": "MIT"
}
PS C:\Users\lizec\Documents\Blog\Fusuma>  npm i fusuma -D # yarn fusuma --dev
npm WARN deprecated [email protected]: true

> [email protected] postinstall C:\Users\lizec\Documents\Blog\Fusuma\node_modules\core-js-pure
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> [email protected] postinstall C:\Users\lizec\Documents\Blog\Fusuma\node_modules\pose-core
> node ./scripts/postinstall.js || exit 0


      +-------------------------------------------------+
      |                                                 |
      |          Hey! Using Pose commercially?          |
      |                                                 |
      |         Pose is completely open source.         |
      |       Its continued development relies on       |
      |          contributions and sponsorship.         |
      |                                                 |
      |          Join us: patreon.com/popmotion         |
      |                                                 |
      +-------------------------------------------------+


> [email protected] postinstall C:\Users\lizec\Documents\Blog\Fusuma\node_modules\spawn-sync
> node postinstall


> [email protected] postinstall C:\Users\lizec\Documents\Blog\Fusuma\node_modules\caporal
> (test -f ./node_modules/husky/bin/install.js && node ./node_modules/husky/bin/install.js) || exit 0


> [email protected] postinstall C:\Users\lizec\Documents\Blog\Fusuma\node_modules\cwebp-bin
> node lib/install.js

  √ cwebp pre-build test passed successfully
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of d3@^4.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ [email protected]
added 1609 packages from 1024 contributors and audited 41051 packages in 142.182s
found 32 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
PS C:\Users\lizec\Documents\Blog\Fusuma>

PS C:\Users\lizec\Documents\Blog\Fusuma> ls


    目录: C:\Users\lizec\Documents\Blog\Fusuma


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        2019/7/28      0:07                node_modules
d-----        2019/7/28      0:09                samples
-a----        2019/7/28      0:08           3921 output.txt
-a----        2019/7/28      0:07         546050 package-lock.json
-a----        2019/7/28      0:07            265 package.json
-a----        2019/7/28      0:03            460 新建文本文档.txt


PS C:\Users\lizec\Documents\Blog\Fusuma> cd .\samples\
PS C:\Users\lizec\Documents\Blog\Fusuma\samples> ls


    目录: C:\Users\lizec\Documents\Blog\Fusuma\samples


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        2019/7/28      0:09                advanced
d-----        2019/7/28      0:09                intro
d-----        2019/7/28      0:09                issues


PS C:\Users\lizec\Documents\Blog\Fusuma\samples> cd .\intro\
PS C:\Users\lizec\Documents\Blog\Fusuma\samples\intro> ls


    目录: C:\Users\lizec\Documents\Blog\Fusuma\samples\intro


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        2019/7/28      0:09                scripts
d-----        2019/7/28      0:09                slides
-a----        2019/7/27     16:46             74 .env.sample
-a----        2019/7/27     16:46            357 .fusumarc.yml
-a----        2019/7/27     16:46             23 index.js
-a----        2019/7/27     16:46           8784 package-lock.json
-a----        2019/7/27     16:46            665 package.json
-a----        2019/7/27     16:46          62328 StratumNo1 Medium.ttf
-a----        2019/7/27     16:46           1137 style.css


PS C:\Users\lizec\Documents\Blog\Fusuma\samples\intro> npx fusuma start
  √ cwebp pre-build test passed successfully
- Starting server...Error: no gitconfig to be found at C:\Users\lizec\Documents\Blog\Fusuma\samples\intro
    at C:\Users\lizec\AppData\Roaming\npm-cache\_npx\1176\node_modules\fusuma\node_modules\gitconfiglocal\index.js:13:27
    at C:\Users\lizec\AppData\Roaming\npm-cache\_npx\1176\node_modules\fusuma\node_modules\gitconfiglocal\index.js:48:48
    at suppressedCallback (fs.js:200:5)
    at FSReqWrap.oncomplete (fs.js:141:20)
/ Starting server...

 ERROR  Failed to compile with 2 errors                                                                                                                         00:12:49

These dependencies were not found:

* \src\entryPoints\Client.js in multi webpack-hot-middleware/client?reload=true regenerator-runtime /src/entryPoints/Client.js ./index.js src/utils/customCss.js
* src\utils\customCss.js in multi webpack-hot-middleware/client?reload=true regenerator-runtime /src/entryPoints/Client.js ./index.js src/utils/customCss.js

To install them, you can run: npm install --save \src\entryPoints\Client.js src\utils\customCss.js
Listening on http://localhost:8080


 WAIT  Compiling...                                                                                                                                             00:12:50



 ERROR  Failed to compile with 2 errors                                                                                                                         00:12:51

These dependencies were not found:

* \src\entryPoints\Client.js in multi webpack-hot-middleware/client?reload=true regenerator-runtime /src/entryPoints/Client.js ./index.js src/utils/customCss.js
* src\utils\customCss.js in multi webpack-hot-middleware/client?reload=true regenerator-runtime /src/entryPoints/Client.js ./index.js src/utils/customCss.js

To install them, you can run: npm install --save \src\entryPoints\Client.js src\utils\customCss.js
终止批处理操作吗(Y/N)? y
PS C:\Users\lizec\Documents\Blog\Fusuma\samples\intro>
@hiroppy
Copy link
Owner

hiroppy commented Jul 28, 2019

I cannot reproduce this issue on my PC(MacOS). Can you submit the reproducible repo?

@LiZeC123
Copy link
Author

Today I tried to install this project on Ubuntu. This problem does not appear. So this should be a bug related to the Windows platform. Since I don't know nodejs, I can't analyze the cause of the error further.

If I find the reason for the error (I am learning nodejs), I will come back to discuss it with you.

@hiroppy
Copy link
Owner

hiroppy commented Jul 28, 2019

Thank you for your investigation. I think this point is not good. https://github.com/hiroppy/fusuma/blob/master/packages/webpack/src/webpack.config.js#L19-L22

Could you confirm to modify from / to \ this file in node_modules if possible?

const configsBasePath = configsEntryPoint
- .split('/src')
+ .split('\src')
  .slice(0, -1)
- .join('/src');
+ .split('\src');
const clientEntryPoint = require.resolve('@fusuma/client');
const clientBasePath = clientEntryPoint
- .split('/src')
+ .split('\src')
  .slice(0, -1)
- .join('/src');
+ .split('\src');
const mdxLoaderEntryPoint = require.resolve('@fusuma/mdx-loader');
const mdxLoaderBasePath = mdxLoaderEntryPoint
- .split('/src')
+ .split('\src')
  .slice(0, -1)
- .join('/src');
+ .split('\src');

@LiZeC123
Copy link
Author

After the above modification, this error did not appear. Now this project can run normally. Thanks for your help!

@hiroppy
Copy link
Owner

hiroppy commented Jul 30, 2019

ok, thank you for investigating. I'll change to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants