ota-meshi / vuepress-plugin-full-text-search2

VuePress v2 plugin that adds full-text search box.
MIT License
34 stars 4 forks source link

Pack Error #28

Closed SummerGua closed 2 years ago

SummerGua commented 2 years ago
  1. I run npm run build and npm pack, a tgz file will be generated
  2. Then I run npm install in playground forder to install it and npm run docs:dev
  3. Errors occur:
    
    > vuepress2-plugin-full-text-search-playground-for-2.0.0-beta.46@1.0.0 docs:dev
    > vuepress dev docs --clean-cache

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of URL. Received undefined at new NodeError (node:internal/errors:372:5) at fileURLToPath (node:internal/url:1420:11) at Object. (C:\Users\sshu\Desktop\vuepress2-plugin-full-text-search\playground-for-2.0.0-beta.43\node_modules\vuepress2-plugin-full-text-search\lib\index.cjs:150:45) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (C:\Users\sshu\Desktop\vuepress2-plugin-full-text-search\playground-for-2.0.0-beta.43\docs.vuepress\config.js:11:14)



Then I try it in another project, this also happens. However, installing it from online npm is ok. How can I solve this problem?
ota-meshi commented 2 years ago

I can't reproduce your problem. If we build on Windows, can the build files be different? I don't have Windows so I can't check it.

SummerGua commented 2 years ago

I can't reproduce your problem. If we build on Windows, can the build files be different? I don't have Windows so I can't check it.

I remove the plugin from the package.json and remove the import, then npm install, then re-add it to the package.json and npm install. The error won't happen. Thanks.