I am writing a bat file to auto install npm packages and install compass. The bat is simple as below:
npm install -g bower
npm install -g grunt-cli
npm install
gem update --system --verbose
gem install compass --verbose
pause
I find that after each command, the bat file auto aborts and won't run next command. How can I make this simple script run continuously and able to re-run many times?
Possibly the npm program is a batch file itself.
Then you need to use call, as only then the program control returns to the caller.
call npm install -g bower
call npm install -g grunt-cli
call npm install
call gem update --system --verbose
call gem install compass --verbose
pause
Related
I am trying to install and run react-devtools. I am following this guide to do that: https://github.com/facebook/react-devtools/blob/master/packages/react-devtools/README.md
The install seems to go ok:
To verify it installed correctly I do this command:
And I go to that directory and verify there is a folder called react-devtools.
To open the tools the docs indicate I should do this:
Back in my project directory I run this command:
And it says command not found. So it looks like I have installed the devtools, but I am unable to open them. What am I doing wrong?
Maybe this is what you want
Fix not run react-devtools
Option 1:
npm uninstall -g react-devtools
npm uninstall -g electron
npm install -g --verbose react-devtools
Option 2: (Fix in Linux, MacOSX)
sudo npm install -g react-devtools --unsafe-perm=true
Refer: react-devtools-command-not-found
if you want to run project level only do the following steps
Install using yarn add --dev react-devtools
Run yarn run react-devtools
To run react-devtools you can run either of the following commands depending on your package manager.
If using yarn:
yarn run react-devtools
If using npm:
npm run react-devtools
The real problem here is you are not giving "super user" permissions for the node package manager for installing the "react-devtools" globally.
Try this command it will fix your problem
sudo npm install -g react-devtools
When ignore the -g parameter in the command npm will install the react-devtools in directory that you currently working in. In your case the home directory.
I'm trying to install the #angular/cli npm package inside of the Google Cloud Shell. When I run npm install -g #angular/cli the package manager does through and starts trying to perform the install and then fails with a permissions issue.
Error: EACCES: permission denied, access '/usr/local/nvm/versions/node/v6.9.2/lib/node_modules'
I've tried to run this with sudo npm install -g #angular/cli but the terminal tells me:
NPM: command not found"
I tried to perform the installation to my $HOME instead, using this gist, but accessing the ~/.bashrc file is denied.
What am I supposed to do in order to install global node packages like this?
Try
$ sudo -i npm install -g #angular/cli
I'm getting this error when I run npm run test for a create-react-app application for the sample test provided. I tried looking for the EMFILE error but I'm unable to understand what's going wrong.
Error: Error watching file for changes: EMFILE
at exports._errnoException (util.js:1022:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
I had the same issue and discovered watchman was not installed.
Run brew install watchman.
Issue is happening since watchman is not installed on your system.
On Linux, you need to do following
Install Watchman using following commands
git clone https://github.com/facebook/watchman.git
cd watchman/
git checkout v4.9.0
sudo apt-get install -y autoconf automake build-essential python-dev libssl-dev libtool
./autogen.sh
./configure
make
sudo make install
Execute tests
sudo npm test
I am trying to use the ng-factory generator to scaffold a new project to build an angularjs component. After the project has been created with the yo ng-factory command, I tried to run it using the gulp serve task but found the following error:
c:\projects\bywebclient>gulp serve
[11:20:51] Loading C:\projects\bywebclient\gulp_tasks\browsersync.js
[11:20:52] Loading C:\projects\bywebclient\gulp_tasks\karma.js
[11:20:57] Loading C:\projects\bywebclient\gulp_tasks\misc.js
[11:20:57] Loading C:\projects\bywebclient\gulp_tasks\webpack.js
[11:21:07] Using gulpfile c:\projects\bywebclient\gulpfile.js
C:\Users\ATUL KALE\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129
gulpInst.start.apply(gulpInst, toRun);
^
TypeError: Cannot read property 'apply' of undefined
at C:\Users\ATUL KALE\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:
19
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:577:11)
at run (bootstrap_node.js:352:7)
at startup (bootstrap_node.js:144:9)
at bootstrap_node.js:467:3
Am I missing something? I already tried to run again the npm install
Thanks,
Atul Kale
Try to reinstall gulp-cli :
npm install -g gulp-cli
npm install -g gulp-cli
And important: after running that command, open a new terminal so it'll take effect.
Upgrade to 4.0 like this:
npm install --save-dev github:gulpjs/gulp#4.0
Uninstall the global gulp installation and local gulp-cli installation. While keeping global gulp-cli and local gulp packages.
npm uninstall -g gulp
npm uninstall -g gulp-cli
npm install -g gulp-cli
npm install --save-dev github:gulpjs/gulp#4.0
I get below error everytime i run
npm install gulp -g --save
TypeError: Cannot read property 'apply' of undefined
at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)
I tried:
npm i -g gulp-cli
and it works for me.
If again i run
npm install gulp -g --save
the above error returns. I noted when i first installed Gulp it was saved in my package.json but now it's absent.
I tried uninstalling both gulp and gulp-cli from my machine (locally and globally), but after uninstall gulp -v, it still showed Gulp CLI 3.9.1, even in new terminal window.
In the end, these are the steps that finally worked for me (seems like CLI simply got cached hard):
Navigate to your project and delete node_modules folder.
Run following:
npm uninstall gulp --global
npm uninstall gulp-cli --global
apt-get remove npm
apt-get remove nodejs
apt-get install nodejs
apt-get install npm
npm install --global gulp-cli
Navigate to your project and run:
npm install
Close current terminal, open new one and check for success:
gulp -v
Should say CLI version 2.1.0 (as of time of writing).
Now you can run your gulp tasks without that error :)
In my case, I had an automated script which was doing npm install gulp (...) and until v3.9x it was fine.
After some time, that naive install would pick v4.0.0, which breaks my CI.
Changing the script to do npm install gulp#3.9.1 reverted things back to normal.
Reinstall gulp and gulp-cli, to install the last version.
npm uninstall -g gulp
npm uninstall -g gulp-cli
npm install -g gulp-cli
npm install -g gulp
And then, close the terminal and open new.
*This command no longer works: npm install --save-dev github:gulpjs/gulp#4.0
I'm new in the Angular development, so I found this template and I would like to use it. So I'm doing this:
sudo apt-get install -y nodejs
sudo apt-get install -y npm
sudo npm install -g bower
sudo npm install -g grunt-cli
Clone the repository of the project:
git clone https://github.com/start-angular/sb-admin-angular.git
cd sb-admin-agular
npm install bower
But when I try to execute the command npm start, it gives me the follow error:
vagrant#TheMachine:~/sb-admin-angular$ npm start
> sb-admin#0.0.0 start /home/vagrant/sb-admin-angular
> grunt serve
/usr/bin/env: node: No such file or directory
npm ERR! weird error 127
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! not ok code 0
vagrant#TheMachine:~/sb-admin-angular$
Any idea how to solve that ? Or what is causing it ?
You might be missing some dependencies. Looks like you only installed bower. Try installing all dependencies using
npm install
Re-follow the installation instructions on the Github page from 5-7:
npm install - bower install is ran from the postinstall
npm start - a shortcut for grunt serve
npm run dist - a shortcut for grunt serve:dist to minify the files for deployment
Some installation routines requires to find the binary "node".
But on Debian based systems the binary is named "nodejs".
To get around this problem I created a syslink.
But be aware that this may introduce other problems later.