I was installing some modules/packages needed for Ethereum development and I previously installed truffle and testrpc, and I could run them fine from PowerShell. I am now suddenly unable to run either as it says 'testrpc' is not recognised as a cmdlet, and 'truffle' is not recognised as a cmdlet. I would appreciate some help on how/why this happened and how to fix it. I also tried restarting my device but that did not help.
Error produced when I run the script/command
If it was working alright previously, uninstalling and reinstalling truffle should work.
npm uninstall -g truffle
npm install -g truffle
In case this does not work, below will work.
run npm init #this will make a new npm project particularly package.json
run npm i truffle #this will download node modules
run ./node_modules/.bin/truffle init #this will create a truffle project
Related
I am new in jhpster-ionic, following this link:
https://www.npmjs.com/package/generator-jhipster-ionic
Everything was fine until I ran this command:
"yo jhipster-ionic --force" in an empty folder.
After running this command, I am getting this error:
Can anyone please help?
Install the dependencies of generator-jhipster-ionic. Change directories to D:\works\jhipster\chharkoi2\chharkoi2\node_modules\generator-jhipster-ionic and run npm install. These dependencies are normally installed when you install a package through npm.
I followed the instructions to install Facebook jest on https://facebook.github.io/jest/docs/getting-started.html#content :
npm install --save-dev jest-cli
After the install command I typed jest in the terminal, and press enter but It popped:
bash: jest: command not found.
But when I run the getting started sample by using npm test in the terminal, it worked well.
So, how can I verify that Facebook jest is installed successfully?
Ways to install a package in npm
In node.js you have two ways to install a package: globally or locally.
The sintax is the following:
// globally
npm install -g [package_name]
// locally
npm install --save-dev [package_name]
So, now what it happens is that you run the local one which downloads the package in node_modules under your project folder.
To check you installed jest properly so you can check on your node_modules if there is a jest folder.
How to check if jest is installed
In addition to that npm is creating a shortcut in you local node_modules under the directory .bin son in there you should find a link to jest.
You can test that like that:
cd your_project_folder
./node_modules/.bin/jest
Why npm test works?
The reason why npm test works is because when you run it npm is going to look for the commands globally and locally.
npm install -g mean-cli works. but mean init says mean is not recognized as a internal command. How do I fix this?
I installed mean-cli from git, worked like a charm.
Open CMD
Run this: npm install -g git://github.com/djskinner/mean-cli.git
Hope this works for you too
It is possibly a NPM cache issue. Try running the following:
Update NPM
npm update -g npm
Then clear your NPM cache
npm cache clean
Once both commands have successfully ran, continue with the init
mean init <yourAppName>
For more reference material be sure to check out the docs at learn.mean.io.
I have installed the module with node version v0.10.22
sudo npm install -g ionic
But know when I am trying to start an new application I am getting a
-bash command not found
which ionic
gives me nothing, do I have to add the path to on the $PATH variable ?
How did you installed npm? If you used homebrew then npm won't put npm files accessible by users.
Add export PATH=/usr/local/share/npm/bin:$PATH to your .bashrc/.bash_profile/.zshrc file and it should work fine.
Also refer this: Bower: "command not found" after installation
About a month ago I installed libxml-ruby using
gem install libxml-ruby
and it worked fine.
Then i went to install it on another machine today and it failed with this error:
C:\Windows\system32>gem install -r libxml-ruby
Building native extensions. This could take a while...
ERROR: Error installing libxml-ruby:
ERROR: Failed to build gem native extension.
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake RUBYARCHDIR=c:/ruby/lib/ruby/
gems/1.8/gems/libxml-ruby-1.1.3-x86-mswin32-60/lib RUBYLIBDIR=c:/ruby/lib/ruby/g
ems/1.8/gems/libxml-ruby-1.1.3-x86-mswin32-60/lib
'c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake' is not recognized as an int
ernal or external command,
operable program or batch file.
Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/libxml-ruby-1.
1.3-x86-mswin32-60 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/libxml-ruby-1.1.3-x86-mswin32-6
0/ext/mingw/gem_make.out
I have rake installed and win32-api
I then got confused if I had really installed libxml-ruby on my machine previously and tried uninstalling and reinstalling it. It now fails with the same error message on my machine and some scripts i've written to parse xml, which used to work, no longer work. Has anyone else tried installing libxml-ruby lately on windows xp? It appears to be completely broken.
I got the same problem, and ended up figuring out a decent work-around.
It seems the error is correct
'c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake'
isn't a valid executable. It needs to run rake from the root ruby/bin folder, where the wrapping batch file can be found.
Rummaging through the rubygems code, I found that Gem::Ext::RakeBuilder tries to build extensions using
cmd = ENV['rake'] || Gem.bin_path('rake') rescue Gem.default_exec_format % 'rake'
So, simply setting the rake environment variable to something valid before running the gem install should help:
C:\>set rake=c:\ruby-1.8.6-26\bin\rake.bat
C:\>gem install libxml-ruby --no-rdoc --no-ri
Building native extensions. This could take a while...
Successfully installed libxml-ruby-1.1.3-x86-mswin32-60
1 gem installed
(I skipped installing rdoc and ri because it prints out a bunch of formatting warnings, making it more difficult to paste the results in here.)