Is this possible to install node-sass offline proxy - angularjs

I'm trying to install node-sass module using npm but each time an error displayed about a problem in network configuration that's because i'm using proxy and private registry this is the error :
This is most likely not a problem with node-gyp or the package itself and is related to network connectivity In most cases you are behind a proxy or have bad network setting
Is it possible to install this module offline ?

I had a similar problem, while trying to install node-sass behind a corporate proxy.
What you can try is:
Download it locally from here:https://github.com/sass/node-sass/releases (choose the right one depending on your OS)
Use the binary configuration parameter –sass-binary-path. to install it.
npm install --sass-binary-path="C:\src\v4.7.2\win32-x64-57_binding.node"

How-to
Download the binary here: https://github.com/sass/node-sass/releases
It vary depending on your OS and node version.
Set up env variable (see https://github.com/sass/node-sass#binary-configuration-parameters)
export SASS_BINARY_PATH=<absolute_path_to_file>
Replace <absolute_path_to_file> by the path to the file you have downloaded. The path should be absolute, and in linux format (if you use git bash, with cmd use Windows format). To get the absolute path, you can go to the directory, open a git bash console and do pwd, append the filename, and you should have something like /c/Users/you/SOFTWARE/win32-x64-64_binding.node.
Install (locally)
npm i node-sass --save
You need to export the variable once for each opened terminal using node-sass. Meaning you should add the export line to your npm start. (so you gotta keep the file you downloaded somewhere safe).
For example you can do "start:dev": "set SASS_BINARY_PATH=%cd%\\win32-x64-64_binding.node && npm start". In this case, the sass binary is inside my project, making it easier for new collaborators. We are using set instead of export because Jetbrain IDE use by default cmd (Windows terminal).
Miscellaneous
If you get an error message like:
Testing binary
Binary has a problem: Error: The module '\\?\C:\Users\myself\SOFTWARE\win32-x64-72_binding.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
It means it have found your binary, but you took the wrong one for your current node version. Dowload the correct version, and do theses above step again.
when using npm start if you have (used on a react-script project):
./src/product-card-list/product-card-list.component.module.scss (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-6-1!./node_modules/postcss-loader/src??postcss!./node_modules/sass-loader/lib/loader.js??ref--6-oneOf-6-3!./src/product-card-list/product-card-list.component.module.scss)
Error: ENOENT: no such file or directory, scandir 'C:\Users\myself\PROJECTS\advisor_spa\node_modules\node-sass\vendor'
You failed step 4. Export SASS_BINARY_PATH again and it should work.
If you use Webstorm, you can make run configuration for npm start and add full path SASS_BINARY_PATH=C:\Users\myself\SOFTWARE\win32-x64-64_binding.node environment variable (for Windows).
If you use Visual Code on Windows, you can add a system env variable, at the same level as PATH (not inside PATH).

Related

Installing Protractor for Angular JS in VScode

I have npm installed globally and installed protractor globally as well. When I check for the node version it returns proper version, but when I am trying to check the version of protractor after installing it gives me the below error. can anyone help me with whats going wrong here?
protractor : The term 'protractor' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1
+ protractor --version
You need to config the global protractor into PATH environment variable through
below two steps:
get npm global package install path by execute following cmd which will print out an absolute folder path.
npm config get prefix
add the install path/bin into PATH environment variable
For example the step 1 print out xxx\yyy, you should add xxx\yyy\bin; into PATH on Windows, Or add xxx\yyy\bin: on Linux.
Important: try protrator --version in new cmd window, Don't try again in previous opened cmd window.

Cannot deploy to with gh-pages with specific project due to error: cannot spawn sh: No such file or directory

Keep getting the error:
error: cannot spawn sh: No such file or directory
fatal: unable to fork
The project builds correctly but when trying to deploy my website it fails.
Website was created with "create-react-app" on my windows 8 pc with the command "gh-pages -d build"
This issue only occurs in this specific project on my pc as when I create a new project with "create-react-app" on my pc it'll deploy fine. This specific project can also be deployed fine with "gh-pages -d build" on my mac but not my pc.
Error of failing to deploy on console
Error log console references
Repository
Somewhere along the line I must've messed up something. I've looked over the web, tried reinstalling git, editor, dependencies and am super confused as to what's causing this. It must be an operating system difference? Thanks!
It's trying to spawn sh.exe but can't find it.
You need to add the git directory that contains sh.exe to your system variables.
(go start and type: 'path'. This should provide you with a shortcut to 'system environment variables'. If not look up how to edit environment variables on your version of windows.)
Once you have the environment variables dialogue box open, have a look in the System variables > 'path' list. There may be a git directory there that doesn't contain sh.exe. You need to replace it with one that does (ensure this also contains git.exe).
On my pc sh.exe was found in:
C:\Program Files\Git\bin
Once this is done restart the terminal and attempt to deploy again.

ModuleNotFoundError in Spyder

I tried to import the biopython package in Spyder and got the error message:
ModuleNotFoundError: No module named 'biopython'
although biopython is installed.
I also checked the PYTHONPATH: there is a path set into the directory where the packages are stored.
Can somebody help? Did I miss something? Thanks for your help!
If you're using Anaconda, it's best to install all the packages you want from Anaconda if possible. You can check if a package is available with (e.g.):
conda search biopython
When I try that command it shows that biopython is available, so assuming you have access to the standard conda channels you should be able to get it this way.
Assuming you haven't already created a conda environment to work with, start by creating a new one with the packages you want to use:
conda create -n myenvname spyder biopython
where myenvname is the name you want to give the environment - call it whatever you like. If you want to use other packages as well, add their names to the end of this command. Then once the env is completed, activate it:
activate myenvname
or if this doesn't work, on Mac or Linux:
source activate myenvname
and start Spyder in this environment:
spyder
Each time you want to use this environment in future you will need to activate it first. You may also be able to do some of these tasks through the Anaconda Navigator or via Start menu shortcuts but the command line version will always work.
If there's a package you want that isn't available from conda but is available via pip, just use the pip command after creating and activating the environment.
If you are using Anaconda, a solution could be
conda install -c main biopython
following https://anaconda.org/main/biopython.
The official repository page helped me when I got your error message because numpy was not in place.

What are dronekit-python dependencies?

The dronekit Getting Started page suggests installing WinPython to use dronekit-Python on Windows because it includes the dependencies. I already have a working Python installation and I prefer not to risk messing it up with WinPython. What are the dependencies I need to install?
As of DKPY 2.0 this is outdated. Also, I might move to making a MavProxy module depending on whether or not the unpaid devs decide to stay when 3DR stops funding Dronekit
I've written a procedure to help with this problem which I've pasted. 3DR claims they're going to fix it, but in the mean time I hope this will help.
This setup is for Windows 64-bit systems only, although similar procedures will work with 32-bit.
Install MAVProxy and run it once before reaching step 5.
Install Notepad++.
Install Python v2.7.
Inside the Python folder, run WinPython Control Panel and select Advanced->Register Python.
Inside the same folder, run WinPython Command Prompt and input the following four commands:
• pip uninstall python-dateutil
• pip install droneapi
• pip install console
• echo module load droneapi.module.api >> %HOMEPATH%\AppData\Local\MAVProxy\mavinit.scr
Install WX Python. It should be the 64-bit Python 2.7 version.
Download and install OpenCV 2.4.11 to any folder
• Copy/paste the file cv2.pyd from OpenCV\build\python\2.7\x64\ to \python-2.7.6.amd64\Lib\site-packages.
Steps 8 through 11 apply to SITL only
Follow the online documentation for setting up Cygwin for SITL in Windows
Go to C:\cygwin\home\Your Username\ardupilot\Tools\autotest\
Open sim_vehicle.sh in Notepad++
• Change line 429 from…
cygstart -w "/cygdrive/c/Program Files (x86)/MAVProxy/mavproxy.exe" $options --cmd="$extra_cmd" $*
to...
cygstart -w "/cygdrive/c/Users/YOUR USERNAME HERE/Desktop/WinPython-64bit-2.7.6.4/python-2.7.6.amd64/Dronekit/Scripts/mavproxy.py" $options --cmd="$extra_cmd" $*
Note: This location changes depending on where you installed WinPython. For me, it was the desktop.
Start simulations as you would normally for SITL. To run Python scripts during the simulations, use the command
• api start Path to script\script_name
To use the code to connect to an actual copter, open WinPython Command Prompt
• Navigate to the folder which contains the scripts you wish to test
• Type mavproxy.py --master=”com##”,57600
• Run your script by typing into the MAVProxy terminal
o api start script_name

rethinkdb index-rebuild complains python driver is missing

Ran into this error when trying to run rethinkdb rebuild command:
Error when launching 'rethinkdb-index-rebuild': No such file or
directory The rethinkdb-index-rebuild command depends on the RethinkDB
Python driver, which must be installed. If the Python driver is
already installed, make sure that the PATH environment variable
includes the location of the backup scripts, and that the current user
has permission to access and run the scripts.
Yet I have the rethinkdb python module installed and path setup properly:
Requirement already satisfied (use --upgrade to upgrade): rethinkdb in
/Library/Python/2.7/site-packages Cleaning up...
Why doesn't this work?
If the rethinkdb-index-rebuild script is not in your PATH, you might be able to invoke the index-rebuild command as
python -mrethinkdb._index_rebuild
Turns out it was a feature implemented in a newer version of the python module. Solved it by:
sudo pip install --upgrade rethinkdb

Resources