Cannot find module gulp.js - reactjs

I checked-out a solution from TFS and I have this error in my console when trying to clean & build a solution - > Error: Cannot find module 'C:..\node_modules\gulp\bin\gulp.js'.
Any idea why is not found?
I tried already to reinstall npm and gulp ( also globally ).

Try this:
cd /usr/lib/node_modules/gulp/node_modules/v8flags
sudo node fetch.js
And that's it. The last instruction will create the required file.

Related

When I tried to run ng new in one of my folders on Mac I am getting error an error stating package install failed and schematic workflow failed

1
how to fix the error which I am getting as shown in screenshot above ? I had used home-brew to install npm and node
Looks like your user dont have required access to complete the package installation so try
sudo ng new comps

Failed with error: ‘‘operator’ is not a valid installed package

Currently I am having problems with loading an R package that I downloaded from github (https://github.com/hafen/operator). I downloaded the package and put it in my local R folder: "C:/..../Documents/R/win-library/3.2/operator".
However, I have not been able to load said package into R. I keep on receiving the following errors when trying to load the package. Can anyone help me. I found an error that I though was somewhat relevant that suggest updating "Rcpp" which I have already done with no success. Thank you in advance for any and all help!
I should add. I looked into this a bit more and realized the issue I am having is revolving around the C script that is contained within the package. If I remove the C script I can load the package, however, some of the package functions are dependent on the script and will not run as a result.
> require(operator)
Loading required package: operator
Failed with error: ‘‘operator’ is not a valid installed package’
or
> devtools::load_all("C:/..../Documents/R/win-library/3.2/operator")
Loading operator
Re-compiling operator
"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:\Users\blakey1\Documents\R\win-library\3.2\operator" \
--library="C:\Users\blakey1\AppData\Local\Temp\Rtmpe611i9\devtools_install_499c5059149c" --no-R --no-data \
--no-help --no-demo --no-inst --no-docs --no-exec --no-multiarch --no-test-load
* installing *source* package 'operator' ...
** libs
Warning: running command 'make -f "C:/PROGRA~1/R/R-32~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-32~1.2/share/make/winshlib.mk" SHLIB="operator.dll" WIN=64 TCLBIN=64 OBJECTS="loess_op.o"' had status 127
ERROR: compilation failed for package 'operator'
* removing 'C:/Users/blakey1/AppData/Local/Temp/Rtmpe611i9/devtools_install_499c5059149c/operator'
Error: Command failed (1)
I was facing the same issue with RTextTools, as RTextTools is now not available on CRAN.
I have Download RTextTools From Given Link

https://cran.r-project.org/src/contrib/Archive/RTextTools/
and copy
RTextTools_1.4.2.tar.gz file in project root folder
then
run this command in project folder in terminal
"R CMD INSTALL RTextTools_1.4.2.tar.gz"
After running this command I receive below error
"ERROR: dependencies ‘SparseM’, ‘randomForest’, ‘tree’, ‘e1071’, ‘ipred’, ‘caTools’, ‘maxent’, ‘glmnet’, ‘tau’ are not available for package ‘RTextTools’"
Now install each dependencies from RStudio or RConsole (Any Editor used by you) by simply running this code
install.packages("caTools")
Install all 9 required packages One By One (In My Case it was 9 Packages Dependencies required by RTextTools)
all packages will be installed except 'maxent'
Now download maxent from the given link
https://cran.r-project.org/src/contrib/Archive/maxent/
and copy maxent_1.3.3.1.tar file in project folder then
run this command in project folder in terminal
"R CMD INSTALL maxent_1.3.3.1.tar"
Now For RTextTools Run this command again in Terminal
"R CMD INSTALL RTextTools_1.4.2.tar.gz"
All is done Now..
But the Last Step is
Load the RTextTools using
library(RTextTools)
You will see one more Error: Load SparseM
Now Loading SparseM use code below
library(SparseM)
and in the last Load RTextTools
library(RTextTools)

Is this possible to install node-sass offline proxy

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).

Grunt build failing

I'm trying to build my angularjs project but i keep getting this error. I have searched for a solution but could not find one. How can i fix this error?
Thanks.
Error message
"/usr/local/bin/grunt" "clean"
>> Local Npm module "grunt-aws" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
Loading "Gruntfile.js" tasks...ERROR
>> Error: Unable to read ".aws.json" file (Error code: ENOENT).
>> No "clean" targets found.
Warning: Task "clean" failed. Use --force to continue.
Aborted due to warnings.
Done.
I think you need to post-install your missing dependencies before your script launches on AWS.
Try adding in your package.json the following:
"scripts": { "postinstall": "npm install" }
Or simply run npm install grunt-aws grunt-contrib-connect ... before starting your app.

yo angular-fullstack failure installing on linux local

Getting the error below. I tried running as sudo and as myself. Same error. This is Linux mint Rosa. The install gets through the yo questionnaire but fails on permissions what looks like it. I am new to Linux. Please help.
create bower.json
fs.js:549
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES: permission denied, open '/home/mastermean/bower.json'
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.writeFileSync (fs.js:1156:15)
at write (/usr/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/commit.js:14:6)
at DestroyableTransform._transform (/usr/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/commit.js:43:7)
at DestroyableTransform.Transform._read (/usr/lib/node_modules/generator-angular-fullstack/node_modules/readable-stream/lib/_stream_transform.js:172:10)
at DestroyableTransform.Transform._write (/usr/lib/node_modules/generator-angular-fullstack/node_modules/readable-stream/lib/_stream_transform.js:160:12)
at doWrite (/usr/lib/node_modules/generator-angular-fullstack/node_modules/readable-stream/lib/_stream_writable.js:335:12)
at writeOrBuffer (/usr/lib/node_modules/generator-angular-fullstack/node_modules/readable-stream/lib/_stream_writable.js:321:5)
at DestroyableTransform.Writable.write (/usr/lib/node_modules/generator-angular-fullstack/node_modules/readable-stream/lib/_stream_writable.js:248:11)
jul#jul-Inspiron-5558 /home/mastermean $
Try running this from a terminal:
cd ~
mkdir app
cd app
yo angular-fullstack
(It may be necessary to run that last command as sudo yo angular-fullstack depending on how yeoman was installed.)
It looks like the file bower.json does not have write permission. You may be able to fix the issue by fixing your existing permissions, but the above sequence should get you going without mucking about with permissions.

Resources