node-windows icon indicating copy to clipboard operation
node-windows copied to clipboard

Cannot find module '@author.io/args'

Open endm opened this issue 3 years ago • 31 comments

Hi, I could install my service, but I can´t start it

This is my error detail.

Error: Cannot find module '@author.io/args' Require stack:

  • C:\Program Files\nodejs\node_modules\node-windows\lib\wrapper.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (C:\Program Files\nodejs\node_modules\node-windows\lib\wrapper.js:3:12) at Module._compile (node:internal/modules/cjs/loader:1103:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\Program Files\nodejs\node_modules\node-windows\lib\wrapper.js' ] }

endm avatar Mar 22 '22 02:03 endm

Are you importing node-windows directly, i.e. require('node-windows')? The issue you're experiencing is one I came across in development, but only when using local references (i.e. require('../')).

coreybutler avatar Mar 22 '22 02:03 coreybutler

This is my install.js. It's the same as example.

var Service = require('node-windows').Service;
var dir = require('path').join(process.cwd(), 'app.js')

var svc = new Service({
  name:'SielconBDCasino',
  description: 'Sielcon BD Casino (MQTT Broker)',
  script: dir,
  env:{
    name: "NODE_ENV",
    value: "production"
  }
});

// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on('install',function(){
  svc.start();
});

// Just in case this file is run twice.
svc.on('alreadyinstalled',function(){
  console.log('This service is already installed.');
});

// Listen for the "start" event and let us know when the
// process has actually started working.
svc.on('start',function(){
  console.log(svc.name+' started!');
});

// Install the script as a service.
console.log("Installing to", dir)
svc.install();

endm avatar Mar 22 '22 02:03 endm

I am experiencing the same issue. I could not make it work with version 1.0.0-beta.7, instead I had to force version 1.0.0-beta,6. I am not sure about this but it seems that lib/wrapper.js contains a typo when importing the Args = require('@author.io/args') . Unless I am missing something, that line should reference @author.io/arg instead

alexmarginet avatar Mar 22 '22 05:03 alexmarginet

I am experiencing the same issue. I could not make it work with version 1.0.0-beta.7, instead I had to force version 1.0.0-beta,6.

me too

iclouden avatar Mar 22 '22 09:03 iclouden

I am experiencing the same issue. I could not make it work with version 1.0.0-beta.7, instead I had to force version 1.0.0-beta,6.

Same here

bidule21 avatar Mar 22 '22 12:03 bidule21

I am experiencing the same issue. I could not make it work with version 1.0.0-beta.7, instead I had to force version 1.0.0-beta,6.

Same

amralaa-MSFT avatar Mar 22 '22 14:03 amralaa-MSFT

Thanks!!!! I'm using V1.0.0-beta.6 now, and it's working!!!

;)

endm avatar Mar 22 '22 14:03 endm

There is a typo in the wrapper file causing this problem... but there is also a conflict. The arg lib uses ESM-only, while this module still supports CommonJS.

I will create a CJS version of the arg lib to resolve this problem for now, but it will take me a day or two. In the meantime, I recommend using 1.0.0-beta.6 until that is complete.

I've also started a discussion to capture community feedback regarding the direction of this project. Please comment at https://github.com/coreybutler/node-windows/discussions/309#discussion-3955262.

coreybutler avatar Mar 22 '22 15:03 coreybutler

Downgrading to 1.0.0-beta.6 solved it for me

esbenvb avatar Mar 23 '22 07:03 esbenvb

same here

lingyuj avatar Mar 25 '22 08:03 lingyuj

Is there any update on this one lately?

gngo2018 avatar Mar 31 '22 17:03 gngo2018

I've been backed up with client projects. I've done part of the arg lib conversion, but am not finished yet.

coreybutler avatar Mar 31 '22 21:03 coreybutler

Hi I read that on April 6th the 1.0.0.beta.7 version should have been fixed. But I have just installed the package on a fresh VM and I still see the error 1067 issue when starting the service.

file *.err.log shows "Error: Cannot find module '@author.io/args'"

Am I missing anything?

Thanks a lot for your valuable work

RobArenzano avatar Apr 11 '22 14:04 RobArenzano

Hi I read that on April 6th the 1.0.0.beta.7 version should have been fixed. But I have just installed the package on a fresh VM and I still see the error 1067 issue when starting the service.

file *.err.log shows "Error: Cannot find module '@author.io/args'"

Am I missing anything?

Thanks a lot for your valuable work

I still see the issue too, others have said beta 6 works so im downgrading and trying it now

ctaylor28 avatar Apr 11 '22 15:04 ctaylor28

Reverting to beta 6 does work, however, shows vulnerability errors due to the optimist package dependency. Does anyone know of a workaround for the vulnerability?

gngo2018 avatar Apr 11 '22 21:04 gngo2018

Reverting to beta 6 does work, however, shows vulnerability errors due to the optimist package dependency. Does anyone know of a workaround for the vulnerability?

Reverting to beta 6 works, but for auto-updating systems it requires manual intervention.

A fixed beta 7 or a fresh beta 8 would be greatly appreciated :-)

RobArenzano avatar Apr 12 '22 08:04 RobArenzano

I am experiencing the same issue. I could not make it work with version 1.0.0-beta.7, instead I had to force version 1.0.0-beta,6.

Exact same

declan-wade avatar Apr 20 '22 00:04 declan-wade

@coreybutler Would Yargs be a suitable replacement? The license is compatible.

baconbrad avatar Apr 22 '22 22:04 baconbrad

@baconbrad I'm sure yargs would work, but it has a lot of dependencies. I wrote the author/arg lib (no dependencies). If another security vulnerability comes up, I can address it (unlike other libraries).

I know folks want this fixed. I want to fix it... but client work is taking precedence at the moment.

coreybutler avatar Apr 22 '22 23:04 coreybutler

@coreybutler Understandable. I didn't initially realize the aim was for a dependency free parser and thought it was just to ditch a known vulnerable one.

baconbrad avatar Apr 22 '22 23:04 baconbrad

@coreybutler - this is a fantastic project !

Just managed to get 1.0.0-beta.6 working 1.0.0-beta.7 has the Cannot find module '@author.io/args' issue

I know folks want this fixed. I want to fix it... but client work is taking precedence at the moment.

tell me about it ;)

I will wait patiently for 1.0.0-beta.8

scdba avatar Apr 29 '22 12:04 scdba

I am experiencing the same issue. I could not make it work with version 1.0.0-beta.7 or 1.0.0-beta.6 either.

Vimlesh22 avatar May 13 '22 20:05 Vimlesh22

For other noobs like me looking to reinvent the same solution of rolling back to 1.0.0-beta.6 Do the the following:

cd c:\path\to\index.js
npm uninstall -g node-windows
npm install -g [email protected]
npm link node-windows

Then review your package.json file to ensure the correct node-windows version is listed in the dependencies section.

RoYoMi avatar May 18 '22 15:05 RoYoMi

Also, I noticed that '@author.io/args' version 1.3.22, the one used in node-windows package.json, is actually in empty folder when you install it with npm.

In other words it's missing index.js.

If you upgrade to 1.3.23 index.js can be found.

Rollbacking to beta 6 for now.

amoscatelli avatar May 30 '22 15:05 amoscatelli

ping

orgads avatar Jul 04 '22 12:07 orgads

as of july 2022 it's still an issue...

Fearodin avatar Jul 19 '22 14:07 Fearodin

@Fearodin - death in the family. Please be patient.

coreybutler avatar Jul 19 '22 15:07 coreybutler

@coreybutler uff sry bro, my condolences!

Fearodin avatar Jul 19 '22 15:07 Fearodin

@Fearodin - death in the family. Please be patient.

my condolences

amoscatelli avatar Jul 19 '22 19:07 amoscatelli

@Fearodin - death in the family. Please be patient.

I landed to this page for obvious reason. But sorry to hear, my condolences.

zeeshaanali avatar Jul 22 '22 16:07 zeeshaanali