Not being able to run bower in VS 2012 - visual-studio-2012

Since yesterday I have been trying to install and use bower for managing my dependencies. After going through many articles although I have been able to install it. I am not being able to run it. Beside many articles I also followed this video:
Bower running in Package Manager Console in Visual Studio install
As the video is in some other languages even though I followed all the commonds, I could not get
$env:path
After doing everything when I type bower in the Package manager console, it gives me error
Thanks in advance for helping me out.
PS: I have already installed npm and node.

In order to use Bower correctly in Windows, you need to install msysgit correctly. This is the requirement as specified in bower github https://github.com/bower/bower#a-note-for-windows-users.
The option you have to select during installation is Run Git from the Windows Command Prompt.
After successful installation. Restart Visual Studio and then you are good to go.

In my case, after installing msysgit, I installed bower using:
PM> Install-Package Bower
Above step automatically installed dependencies (node.js, jquery)
I also had to specify relative path to bower.cmd:
PM>.\MyProject.bin\bower.cmd install semantic-ui

Related

Installing --global windows-build-tools never completes

I am trying to install --global windows-build-tools by running below command
npm install --global windows-build-tools -verbose
No matter if I try through PowerShell or CMD (both as Administrator), the installation gets stuck in the same step.
npm info run windows-build-tools#5.2.2 postinstall node_modules/windows-build-tools node ./dist/index.js
[##################] | reify:resolve: info run windows-build-tools#5.2.2 postinstall node_modules/windows-build-tools node ./dist/index.js
Is there a reason why this might not complete?
According to the windows-build-tools repo
Please note that the official Node.js for Windows installer can now
automatically install the required tools. That's likely a much better
option than the module listed here (windows-build-tools).
recommended approach:
Go to node-download-page
Download LTS version for windows
Follow the installation instructions
When you got to this window, check the checkbox
After the installation it will prompt you to this window, it will automatically download the necessary dependencies
If you want to use this package(not recommended):
You should try to roll back to version 4.0.0
Run the command-line as administrator and try this:
npm install --global windows-build-tools#4.0.0
related question
If you're having trouble installing windows-build-tools (which I had a problem with recently), you should roll back to version 4.0.0.
Run PowerShell as Administrator, and then type in the following command (assuming you have node and npm installed).
npm install --global windows-build-tools#4.0.0
This process can take some time, so please be patient.
Built-in Node.js Build Tools
There are built-in Node.js build tools, so it is recommended to use this. In fact, if you go on the npm or GitHub page of the windows-build-tools package, it will say that you should use the Node.js build tools.
To do this, go to the official Node.js download website, and download the LTS version. Then, run the installer. At a point in the installation, it will have a checkbox that says Automatically install the recommended tools. Make sure to check that!
When you install it, it will also install Chocolatey, and install the build tools like the windows-build-tools package.
Even though both of these work, it is recommended to use the Node.js built tools!
Following this thread for a while now.
Disclaimer: Please note that I know this is not directly answering your question about why the process gets stuck but I want to share my solution anyway.
The installation via chocolatey did not work for me, as mentioned in:
https://github.com/felixrieseberg/windows-build-tools/issues/245
https://github.com/felixrieseberg/windows-build-tools/issues/152
Then, I found this microsoft page. On this page, the person asked this question:
I tried to install the Microsoft Visual C++ Build tools. The installer
(filename is visualcppbuildtools_full.exe) stops right after the start
of the installation it says a setup package is missing or damaged("Ein
Setuppaket fehlt oder ist beschÃĪdigt"). The option to download it
again doesnt work. Downloading the installer again doesnt help. Trying
to do an offline installation doesnt work either and I get the same
error. How can I find out what exactly the problem is and how can I
solve it?
The solution mentions the page https://my.visualstudio.com/Download that provides different build tool versions:
I was able to download and install "Build Tools for Visual Studio 2017 (version 15.9)".

Unable to build native packages for node

So Im running an Electron app that has some native modules of one them being a package called better-sqlite3. I run yarn and yarn is able to install all packages without a problem but when it gets to the building steps, everything breaks.
I get a bunch of diffrent node-gyp error outputs of which 2 I have been able to save so I can show here here is the important part of the error output for the first error:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(67,5): error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\bepop\Documents\DeveloperData\Clippy\app\node_modules\better-sqlite3\build\deps\action_before_build.vcxproj]
Full error
In terms of this error I've tried doing multiple things such as installing microsoft visual build tools in many diffrent ways such as manually going to their website and downloading the IDE, I've also tried installing the build tools through NPM with:
npm install --global --production windows-build-tools
It always succesfully installs the build tools but still it errors out on me, I've also tried editing the npm config with:npm config set msvs_version 2017
still doesnt work. I have also tried going to the installation of the Visual Studio and manually checking: "VC++ 2017 version 15.7 v14.14 latest v141 tools"
Also nothing.
I do remember at some point I was able to get everything to build normally with Windows 10 and I never had a problem but not anymore. I've been trying to fix this issue by myself for months now and I've just been sticking on working on the project on my macbook where it never has issues building the better-sqlite3 package.
1 more thing I have tried is completely wiping my computer from everything and starting fresh because at some point i had changed so many things that I lost track of what I had installed and what I did not.
If I remove the better-sqlite3 package from the package.json file everything runs smoothly and I am able to run my project normally but I need the better-sqlite3 package. I could use another package but I really shouldnt have to do that, I'd like to get to the bottom of why this i snot building.
Edit:
Updated: I added Microsoft build tools v14.0.23107.0 to my pats variable and now it outputs error:
C:\Users\bepop\Documents\DeveloperData\Clippy\node_modules\integer\build\integer.vcxproj(21,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Fixed the issue for myself:
Delete node modules folder
Open PowerShell with admin privileges and run in order
npm install --global --production --vs2015 --add-python-to-path windows-build-tools
npm install --global --production --add-python-to-path windows-build-tools node-gyp
Go to ~/.npmrc and make sure these are your settings:
msvs_version=2015
python=python2.7
First remove all the visual studio version installed from your system , and also remove the entries from path and system variable .
and follow the below URL
https://github.com/nodejs/node-gyp#readme
Every thing run fine after removing of better-sqlite3 this package entry from package.json because other packages don't have any native dependency . and this better-sqlite3 is native module after downloading, this module get build using tool node-gpy that will need two things installed on your system i.e. python and visual studio .
So try to follow the above URL steps.
it will definitely work.

Npm error cannot find module

While running npm command I get the error
Error: Cannot find module 'C:\Windows\System32\node_modules\npm\bin\npm-cli.js'.
I tried uninstalling and installing nodejs but with no luck. Also I tried configuring the env vars
I'm not entirely sure about this, but I dont remember having nodejs/npm installed in Windows directory. It should be in your Appdata somewhere. Your install Paths maybe somehow corrupted
But here is a possible solution:
Go here:
Install it and run the following commands:
nvm list
nvm install [version]
for example:
nvm install v10.15.3
The Command should automatically select the installed version as default.
For further information check their Github Readme.
If they don't work right off, be sure to restart the Version Manager OR be sure to follow the instructions led out by the Github Readme.
Version Manager have one big benefit: The Community keeps them updated and because they use different Path architectures they can be installed at places where they weren't originally meant to be from the original installer which lead to a whole different outcome for you because they probably will not install directly into System32.
Other Node Version Manager you could check out (should all be Windows):
https://github.com/hakobera/nvmw
https://github.com/nullivex/nodist
Hope it helps!

Yeoman dependencies for AngularJS project

Using Yeoman and the AngularJS generator I could previously follow their tutorial and install all the necessary packages and tools (bower, gulp, grunt,...) to get up and running. Per their website:
npm install -g yo bower grunt-cli gulp
then added the angularJS project 'generator':
npm install -g generator-angular
created a folder locally, and run
yo angular
in that folder in order to prepare a sample AngularJS project with all the necessary tools and scaffolding generated by Yeoman.
The command:
grunt serve
Launched the sample application successfully, allowing me to start learning about AngularJS (which I'm very new to).
The problem: I have repeated these steps again, (3 months later), and, admittedly, I have potentially taken on updates to some of the installed packages.
Now, when I create a new project and invoke 'grunt serve' I get:
Running "concurrent:server" (concurrent) task
Warning: Running "compass:server" (compass) task
Warning: Command failed: C:\Windows\system32\cmd.exe /s /c "compass.bat --versio
n"
'compass.bat' is not recognized as an internal or external command,
operable program or batch file.
Use --force to continue.
Aborted due to warnings.
and the site does not launch...
Researching this problem, some responses say that I now need to install yet another tool - Ruby, followed by the 'compass' gem.
Is this really necessary ?? (I'm hesitant because the Yeoman website does not require this to get started using the angular generator).
Is there perhaps another solution ?
thanks
It seems like compass is necessary by default.
It also seems that the only solution here is to go ahead and download Ruby (if you do not already have it), in order to install compass. These instructions cover how:
Download Ruby here: http://rubyinstaller.org/downloads/ and install.
Install the compass library: gem install compass
Yes compass is necessary.
Download and install ruby http://rubyinstaller.org/downloads/
and run gem install compass in ruby command prompt to install compass.
now it will work!!!.

Can no longer deploy a webapp using Yeoman, Grunt and Bower even after reinstalling

I have deployed many webapps using Yeoman, Grunt and Bower. Recently, though, when I ran yo webapp, and opted in for SASS, although it built successfully, it gave the following error in the top right corner of my screen (MAC OS 10.10.5):
(Expanded message):
I could still run the webapp with grunt serve, and it was functioning, although whenever I tried to change the relevant path in my main.scss, something would automatically change it back upon saving, and the above error message would return.
In an effort to resolve this, I tried reinstalling npm, node, bower and grunt. After no effect, I tried completely uninstalling node and npm as per this answer, and then reinstalling from fresh. My npm version is 2.14.3 and my node version is 4.1.0.
Now, I am completely unable to deploy a webapp using yo webapp. Here is the error, the warning seems to be related to Bower:
There are similar problems when running other webapps, such as the official angular webapp.
How can I resolve this situation?
It seems like the bower install step didn't go through (in both cases):
before you reinstall: it couldn't find bootstrap scss file (the bower install might have fail on this dependency)
after you reinstall: it cannot find any bower packages.
Try to run bower install.
You'll find out some errors (like you're behind some proxy or your git clone is failing ...)
If you still have a file import problem: In app/styles/main.scss, remove the comments (bower:scss and endbower).

Resources