Error cannot find module commander



Error: Cannot find module ‘commander’ #76

Comments

devurandom commented Oct 8, 2015

When I try to run htmlhint , I get following error message:

The text was updated successfully, but these errors were encountered:

yaniswang commented Oct 9, 2015

Try to update node to new version v4.1.2, then try reinstall htmlhint again.

npm install htmllint -g

Your node version is too old.

devurandom commented Oct 9, 2015

Ok. Do you know of any Ubuntu PPA that has Node v4.1.2 packaged? The only one I found did not advance much further than Ubuntu Trusty itself.

yaniswang commented Oct 9, 2015

It seems your nodejs is not instal well,so the dependencie cannot finded.

devurandom commented Oct 9, 2015

My NodeJS installation is just the original package from Ubuntu. I did not modify anything.

waldyrious commented Oct 9, 2015

@devurandom according to this page on nodejs.org there used to be an up-to-date PPA (Chris Lea’s), but it’s now transitioned into the NodeSource process, which I’m not sure how it works (it seems to be removing the PPA but not adding a new one). Anyway, if you follow the instructions on the nodejs.org page linked above, it should allow you to update node. You might have to remove your current installation first, or maybe NodeSource takes care of that. Try it out and see if it works for you 🙂

devurandom commented Oct 9, 2015

@waldyrious Thanks! After installing the current version of NodeJS, uninstalling all modules with npm uninstall and rm -fr

/.npm , then reinstalling htmlhint, it appears to work.

waldyrious commented Oct 9, 2015

@devurandom great to hear 🙂 you can close this issue then.

Footer

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Cannot find module ‘commander’ #5

Comments

lammertw commented Oct 24, 2019

Running localicious gives me the following error:

The text was updated successfully, but these errors were encountered:

larslockefeer commented Oct 24, 2019 •

Thanks! We’re still working out the last kinks before we can release 1.0 to npm and a report like this is very helpful.

For me, it works when I go through the following steps:

  1. git clone git@github.com:PicnicSupermarket/localicious.git && cd localicious
  2. yarn install
  3. node bin/localicious

Can you share the steps that you went through that cause this failure for you?

Once we are done with the 1.0 (most likely before the end of next week) we will publish the tool to npm such that it can be installed globally.

Читайте также:  1с неустранимая ошибка приложения thinapp has encountered an unexpected error

Also not that the syntax of the Localicipe will still change a bit today/tomorrow as a result of #3.

lammertw commented Oct 24, 2019

The yarn install is missing from the Requirements and installation section so I didn’t run that.

When I now run it, it still fails.

Am I supposed to run it with localicious render ./copy.yaml or localicious render ./LocaliciousConfig.yaml ? Both result in different errors. I don’t have a file named copy.yaml but the docs mention this so I’m not sure if it’s supposed to be the output or input file.

When running localicious render LocaliciousConfig.yaml . —platforms android —languages en I get the following:

Contents of LocaliciousConfig.yaml:

larslockefeer commented Oct 24, 2019 •

I’ll update the Requirements and installation section, it is indeed still a placeholder.

As for your other question, we have two commands:

localicious render : Renders a Localicipe. A Localicipe is the YAML file that contains the copy. It should indeed look like what you posted above.

localicious install : Pulls a Localicipe from the source configured in the provided localicious config and renders it for the languages and platforms configured in the same file.

A LocaliciousConfig looks like this.

The error you are running into looks like a bug. If you change your Localicipe to the following, it should work:

Источник

5. Install MKDIRP, this module is used to create a directory.

E:\Program Files\nodejs\node_modules>npm install mkdirp —save
npm WARN saveError ENOENT: no such file or directory, open ‘E:\Program Files\nod
ejs\package.json’
E:\Program Files\nodejs
`— [email protected]
`— [email protected]

This error occurs because the installation is not entered into the npm directory.

Enter cd /usr/local/node/lib/node_modules/npm

# npm install mkdirp —save

npm]# npm install mkdirp —save
+ [email protected]
updated 1 package and moved 1 package in 3.675s

NPM package installation is divided into local installation (Local), global installation (global), from the knocking command line, the difference is only the -g, such as:

npm install —save Write information into package.json while installing

-save-dev refers to the package information to DEVDependencies, indicating that the parcel you depend on time.

-save refers to the package information to Dependencies, indicating that you rely on the package.
For example, we will use Gulp when developing to compress our files. This is our Gulp package information will be added to DEVDependencies, and we publish compressed files when publishing, do not use Gulp.
Using the server built by NodeJS is sent frequently after the release, the information of the HTTP package is added to the DependenCIES area.

Читайте также:  Error 102 failed to perform flash

The following explanation.

1. When npm install xxx -g, the module will be downloaded to the [Global Directory].

[Global Directory] Sets via NPM Config Set Prefix «Directory Path».

Gets the current settings through NPM Config Get Prefix.

2. NPM Install XXX is the directory where the module is downloaded to the current command line.

Module Path responsible for formatting the picture name

responsible for processing an asynchronous perspective module async

Источник

How to solve «Error: Cannot find module ‘*.js'» with Node.js

Introduction

If you are trying to run your Node.js application and you get something like this:

then you are most likely trying to run the wrong file. It is possible you are missing a dependency that is needed from npm install , but if it says it cannot find the main file you are trying to run, then you are trying to run a file that does not exist. It is a common mistake.

How to fix «Error: Cannot find module»

You need to double check you are running the correct file from the correct directory. Here are some steps to diagnose.

General tips

Here are some general things to keep in mind when diagnosing the issue:

  • Make sure you are in the correct directory.
  • Make sure you are trying to run the correct file name.
  • File and directory names are case sensitive.

How to change directories

To change directories, use the cd command in your terminal. For example, if your username was Me on the computer:

How to see what directory you are in

To check what directory you are currently in, use the folowing in your terminal.

How to print the contents of current directory

To see what files and directories exist in your current directory use the following in your terminal:

Conclusion

After reading this you should have some idea why you get the error Error: Cannot find module and how to diagnose and fix the problem.

Источник

Error: Cannot find module commands #349

Comments

crimson-med commented May 23, 2020 •

Report a bug?

What is the current behavior?

Published some updates on my package on npm and it is full broken.
Steps to reproduce:

  • yarn global add vestigo
  • vestigo scan —target=»https://127.0.0.1/» —method=»GET» -w

This does not happen with prior versions:

  • yarn global add vestigo@0.0.5
  • vestigo scan —target=»https://127.0.0.1/» —method=»GET»

This does not happen while debugging:

What is the expected behavior?

The command line is supposed to run like in prior versions

Читайте также:  Pcl xl error subsystem inputreaderror

The text was updated successfully, but these errors were encountered:

crimson-med commented Jun 15, 2020

Any ideas on what could be causing this issue?

RasPhilCo commented Jul 3, 2020

Try installing with npm globally, yarn globally sometimes gets wonky.

martinlarosa commented Oct 28, 2020

Same thing is happening to me, it was working fine and then newer versions stopped working with that error.
I’m not using yarn.

martinlarosa commented Oct 28, 2020

It’s not generating any output into the lib directory. I have 3 commands, referencing other files under src/ and under another directory inside src/
Then I modify the file of one of the commands (just removing a line break), do npm pack and that file gets to the lib directory and into the packagle.
But then I run npm pack again withouit modifying any file and the lib is empty again

martinlarosa commented Oct 28, 2020

Weird thing is that the readme.md file and the help result is updated correctly

crimson-med commented Oct 28, 2020

Never been able to solve it personally I just have to run in dev mode. This really hinders my project so I’m thinking to find an alternative

martinlarosa commented Oct 28, 2020

Found the problem @crimson-med !
There’s a file in my directory called tsconfig.tsbuildinfo, that keeps a signature of the files. Clearly if the file didn’t change then it doesn’t compile it again.I don’t know when or why that file appeared there, but deleting the file fixes the problem.
The issue is that it appears again after packaging it again. So what I did was to add the removal of that file to the postpack script. Maybe it should go into the prepack? I’m not sure but this works for now.

Now my postpack looks like this : «postpack»: «rm -f oclif.manifest.json tsconfig.tsbuildinfo»,

crimson-med commented Nov 1, 2020

I tried that but it makes no difference for me @martinlarosa

dmoosocool commented Dec 24, 2020

@martinlarosa hi, thanks your idea. but this doesn’t seem to work for me.

«postpack»: «rm -f oclif.manifest.json tsconfig.tsbuildinfo»,

my package.json scripts:

this is yarn publish log,

The log shows its execution order

  1. run version script.
  2. run prepack script.
  3. run postpack script.

when executing yarn publish , the tsconfig.tsbuildinfo file may not be deleted when the prepack command was triggered.

so I try to delete the tsconfig.tsbuildinfo file in the prepack command.

here is updated package.json scripts:

its works for me..

@crimson-med If you are in the same situation as me, you can also try.

Источник

Оцените статью
toolgir.ru
Adblock
detector