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

build error when add registry-js #190

Open
zredb opened this issue Sep 2, 2020 · 7 comments
Open

build error when add registry-js #190

zredb opened this issue Sep 2, 2020 · 7 comments

Comments

@zredb
Copy link

zredb commented Sep 2, 2020

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"

registry-js@1.11.0 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: fsevents@2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

  • registry-js@1.11.0
    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:

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?

@niik
Copy link
Member

niik commented Sep 3, 2020

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 registry-js@1.9.0

@moshfeu
Copy link

moshfeu commented Nov 7, 2020

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

@williamweckl
Copy link

williamweckl commented Mar 8, 2021

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
Copy link

Apparently fixed adding node-loader to webpack.

@tylerlong
Copy link

tylerlong commented Aug 15, 2021

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

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

@jamesbattersby
Copy link

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.

@lemontree2000
Copy link

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😂

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

7 participants