I have tried to run
nexe --help
or
nexe index.js
but it has returned this error:
Command 'nexe' not found, did you mean:
command 'rexe' from snap rexe (0.7)
command 'next' from deb mailutils-mh (1:3.7-2.1)
command 'next' from deb mmh (0.4-2)
command 'next' from deb nmh (1.7.1-6)
command 'nex' from deb nvi (1.81.6-15build1)
See 'snap info <snapname>' for additional versions.
I am using an Ubuntu system. How do I solve it?
Solution
First, uninstall the nexe module installed on the system locally and remove it from package.json using:
npm uninstall nexe -S
or if it is a dev dependency, use:
npm uninstall nexe -D -S
If you installed it globally, use:
npm uninstall nexe -g
Now install the package using the sudo command as a global package:
sudo npm i nexe -g
Run the command again once fully installed:
nexe --help
If it gives out the help console output, run now:
nexe index.js
Related
I have installed the package.json that includes nodemon package (and others)
#npm list --depth 0
├─┬ nodemon#2.0.7
but the command #nodemon -v return a -bash error: "nodemon command not found”
I cant start my server.js with nodemon, the same error, but all works with #node server.js
Any idea? Thnks
With a local install
You can use npx nodemon filename.js
If you want to install it globally
With npm npm install nodemon -g or with yarn yarn global add nodemon, that way you can use nodemon directly (nodemon filename.js)
I have installed mean.io and ran sudo npm install. Actually following commands in sequence
sudo npm install -g meanio
mean init yourNewApp
cd yourNewApp
sudo npm install -g bower
sudo npm install
It is supposed to download and install angularjs libraries into public/system/lib. After doing the above steps public /system/lib is not created due to which when I start the application I get the error
events.js:72
throw er; // Unhandled 'error' event
^
Error: ENOENT, open '/home/santhosh/dev/scaleqa/mean_tut/old mean/temp/myapp/public/system/lib/bootstrap/dist/css/bootstrap.css'
[nodemon] app crashed - waiting for file changes before starting...
Is it something to do with certain npm/angularjs server being down. I have faced this problem earlier also but got fixed on 2nd try and I didn't bother to do more research. This became a big issue when I try to pull my repo into cloud and start the application. public/system/lib is added in .gitignore by default and is expected to be created during npm install.
I get following warnings with sudo npm install
npm WARN package.json mean-connect-mongo#0.4.3 No repository field.
npm WARN cannot run in wd mean#0.3.3 node node_modules/bower/bin/bower install (wd=/home/santhosh/dev/scaleqa/mean_tut/old mean/temp/myapp)
this is link to package.json
The problem maybe related to running npm install as sudo, which can cause problems. As mentioned in another stack overflow question, this can be worked around in a couple ways. But because it looks like this is being run from your home directory, you really shouldn't need to run npm install as root.
Try to issue the same commands, but the last without sudo:
sudo npm install -g meanio
mean init yourNewApp
cd yourNewApp
sudo npm install -g bower
npm install
Note that the reason you may need to run npm install -g <package> using sudo is because by default npm uses /usr/local for global installs, which can be a restricted directory. However, when you install a package locally (without the -g flag) you should not need to run as root.
In my project directory, I installed Grunt by using the following command:
npm install grunt
...after that I did Grunt server in my project directory but it gives me command not found error.
Raj$ grunt server
-bash: grunt: command not found
And:
npm install grunt
npm WARN package.json BID-2.0#0.0.0 No description
npm WARN package.json BID-2.0#0.0.0 No repository field.
npm WARN package.json BID-2.0#0.0.0 No README data
How can I fix it?
You need to install Grunt's command line interface (CLI) globally as well.
From their site:
npm install -g grunt-cli
You may need to use sudo command (for OSX, *nix, BSD etc) or run your command shell as Administrator (for Windows) to do this.
This will put the grunt command in your system path, allowing it to be run from any directory.
You will have to install grunt after installing node / npm with: npm install -g grunt. Then it will be available at the cmd.
After installing gulp.js via npm, I receive a no command 'gulp' found error when running the gulp command from the same directory it was installed into.
When looking under the node_modules/.bin/ directory, I can see the gulp executable there.
Is there something wrong with my npm installation?
That's perfectly normal.
If you want gulp-cli available on the command line, you need to install it globally.
npm install --global gulp-cli
See the install instruction.
Also, node_modules/.bin/ isn't in your $PATH. But it is automatically added by npm when running npm scripts (see this blog post for reference).
So you could add scripts to your package.json file:
{
"name": "your-app",
"version": "0.0.1",
"scripts": {
"gulp": "gulp",
"minify": "gulp minify"
}
}
You could then run npm run gulp or npm run minify to launch gulp tasks.
I solved the issue without reinstalling node using the commands below:
$ npm uninstall --global gulp gulp-cli
$ rm /usr/local/share/man/man1/gulp.1
$ npm install --global gulp-cli
I actually have the same issue.
This link is probably my best guess:
nodejs vs node on ubuntu 12.04
I did that to resolve my problem:
sudo apt-get --purge remove node
sudo apt-get --purge remove nodejs
sudo apt-get install nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node
I solved the issue removing gulp and installing gulp-cli again:
rm /usr/local/bin/gulp
npm install -g gulp-cli
if still not resolved try adding this to your package.js scripts
"scripts": { "gulp": "gulp" },
and run npm run gulp
it will runt gulp scripts from gulpfile.js
Installing on a Mac - Sierra - After numerous failed attempts to install and run gulp globally via the command line using several different instructions I found I added this to my path and it worked:
export PATH=/usr/local/Cellar/node/7.6.0/libexec/npm/bin/:$PATH
I got that path from the text output when installing gulp.
Tried with sudo and it worked !!
sudo npm install --global gulp-cli
I'm on lubuntu 19.10
I've used combination of previous answers, and didn't tweak the $PATH.
npm uninstall --global gulp gulp-cli
This removes any package if they are already there.
sudo npm install --global gulp-cli Reinstall it as root user.
If you want to do copy and paste
npm uninstall --global gulp gulp-cli && sudo npm install --global gulp-cli
should work
I guess --global is unnecessary here as it's installed using sudo, but I've used it just in case.
in my case there was only on issue, just put "gulp":"gulp" in the script portion, of package.json, and then use command npm run gulp.
I used Homebrew to install Node.js, then used npm install to install Grunt and its dependencies, but after the installation completed, I was not able to run Grunt:
zsh: correct 'grunt' to 'grn' ÆnyaeÅ? n
zsh: command not found: grunt
What is the proper method of installing Grunt so I do not get this error?
To use Grunt on the command line, you have to install the command-line interface:
npm install -g grunt-cli
The -g flag is for installing the module globally, which will also create a PATH variable for Grunt.
npm install -g grunt-cli => This will put the grunt command in your system path