registry-js icon indicating copy to clipboard operation
registry-js copied to clipboard

build error when add registry-js

Open zredb opened this issue 5 years ago • 8 comments

Hi, When I add registry-js via npm install registry-js, the program build will fail. the details log is as below:

======================================================================= C:\code\Msp_electron>npm install registry-js --python="C:\Users\zredb\miniconda3\python.exe"

[email protected] install C:\code\Msp_electron\node_modules\registry-js prebuild-install || node-gyp rebuild

prebuild-install WARN install unexpected end of file

C:\code\Msp_electron\node_modules\registry-js>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_ modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) 在此解决方案中一次生成一个项目。若要启用并行生成,请添加“-m”开关。 main.cc win_delay_load_hook.cc 正在创建库 C:\code\Msp_electron\node_modules\registry-js\build\Release\registry.lib 和对象 C:\code\Msp_electron\node_modules\registry-js\build\Release\registry.exp registry.vcxproj -> C:\code\Msp_electron\node_modules\registry-js\build\Release\registry.node 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"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\webpack-dev-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\watchpack-chokidar2\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 34 packages from 25 contributors, removed 2 packages and audited 1666 packages in 25.114s found 1 low severity vulnerability run npm audit fix to fix them, or npm audit for details

C:\code\Msp_electron>yarn serve yarn run v1.21.1 $ vue-cli-service electron:serve INFO Starting development server... 98% after emitting CopyPlugin

DONE Compiled successfully in 28118ms 9:11:15

App running at:

  • Local: http://localhost:8080/
  • Network: http://192.168.1.32:8080/

Note that the development build is not optimized. To create a production build, run yarn build.

\ Bundling main process...

ERROR Failed to compile with 1 errors 9:11:18

error in ./node_modules/registry-js/build/Release/registry.node

Module parse failed: Unexpected character '�' (1:2) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders (Source code omitted for this binary file)

@ ./node_modules/registry-js/dist/lib/registry.js 5:6-50 @ ./node_modules/registry-js/dist/lib/index.js @ ./src/background.js @ multi ./src/background.js

ERROR Build failed with errors. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

C:\code\Msp_electron>

Any one can give some suggestion?

zredb avatar Sep 02 '20 01:09 zredb

Hey @zredb, I'm afraid the loh you provided doesn't give us much to go on.

Have you been able to use registry-js in the past? We've done a few recent updates so I would try installing an older version and seeing if the problem exists there as well npm install [email protected]

niik avatar Sep 03 '20 06:09 niik

I have the same problem. I'm using https://github.com/juliangruber/downloads-folder which uses 1.12.0. It worked before (In the last few monthsI don't remember exactly when.

node: v12.13.1
os: mac os 10.15.6

moshfeu avatar Nov 07 '20 22:11 moshfeu

I´m experiencing the same issue here. Is there a workaround?

I tryed some older versions too, every version until 1.6.0. I am able to install the dependency, but when my app starts it returns the error:

 error  in ./node_modules/registry-js/build/Release/registry.node

Module parse failed: Unexpected character '�' (1:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)

Maybe there is something related to my webpack config...

williamweckl avatar Mar 08 '21 21:03 williamweckl

Apparently fixed adding node-loader to webpack.

williamweckl avatar Mar 08 '21 21:03 williamweckl

I confirm that the issue disappeared after adding the following to webpack configuration:

{
        test: /\.node$/,
        use: {
          loader: 'node-loader',
        },
},

tylerlong avatar Aug 15 '21 20:08 tylerlong

Had the same problem using downloads-folder 1.0.4. in my VSCode extension Tried adding the node-loader as suggested, but it didn't work for me. Ended up going back to downloads-folder 1.0.3, which doesn't pull in registry-js.

jamesbattersby avatar Oct 19 '21 08:10 jamesbattersby

Had the same problem using downloads-folder 1.0.4. in my VSCode extension Tried adding the node-loader as suggested, but it didn't work for me. Ended up going back to downloads-folder 1.0.3, which doesn't pull in registry-js.

That's how I solved it, but downloads-folder 1.0.3 some problems #5, This is not a good solution😂

lemontree2000 avatar Nov 12 '21 03:11 lemontree2000